Ver Fonte

Integrate: Fix to CATCH_CPP_ASSIGN_HRESULT and validation of named metadata

Tex Riddell há 8 anos atrás
pai
commit
74049c5852
2 ficheiros alterados com 6 adições e 9 exclusões
  1. 1 1
      include/dxc/Support/Global.h
  2. 5 8
      lib/HLSL/DxilValidation.cpp

+ 1 - 1
include/dxc/Support/Global.h

@@ -59,7 +59,7 @@ void CheckLLVMErrorCode(const std::error_code &ec);
   catch (std::bad_alloc&)                   { hr = E_OUTOFMEMORY; } \
   catch (hlsl::Exception& _hlsl_exception_) {                       \
     _Analysis_assume_(DXC_FAILED(_hlsl_exception_.hr));             \
-    return hr = _hlsl_exception_.hr;                                \
+    hr = _hlsl_exception_.hr;                                       \
   }                                                                 \
   catch (...)                               { hr = E_FAIL; }
 #define CATCH_CPP_RETURN_HRESULT() \

+ 5 - 8
lib/HLSL/DxilValidation.cpp

@@ -2652,16 +2652,13 @@ static void ValidateMetadata(ValidationContext &ValCtx) {
     ValCtx.EmitFormatError(ValidationRule::MetaTarget, {target.c_str()});
   }
 
+  // The llvm.dbg.(cu/contents/defines/mainFileName/arg) named metadata nodes
+  // are only available in debug modules, not in the validated ones.
+  // llvm.bitsets is also disallowed.
+  //
+  // These are verified in lib/IR/Verifier.cpp.
   StringMap<bool> llvmNamedMeta;
-  // These llvm named metadata is verified in lib/IR/Verifier.cpp.
-  llvmNamedMeta["llvm.dbg.cu"];
-  llvmNamedMeta["llvm.dbg.contents"];
-  llvmNamedMeta["llvm.dbg.defines"];
-  llvmNamedMeta["llvm.dbg.mainFileName"];
-  llvmNamedMeta["llvm.dbg.args"];
   llvmNamedMeta["llvm.ident"];
-  // Not for HLSL which does not have vtable.
-  // llvmNamedMeta["llvm.bitsets"];
   llvmNamedMeta["llvm.module.flags"];
 
   for (auto &NamedMetaNode : pModule->named_metadata()) {