Explorar el Código

Disable OOM test; remove unused getMemBufferCopy in DxCompiler APIs

- OOM test is problematic, and it's not trivial to fix at this time.
  See note where test is disabled.
- getMemBufferCopy is called in two DxCompiler APIs, but the result is
  never used, so I removed it.
Tex Riddell hace 6 años
padre
commit
52c8326a5b

+ 0 - 4
tools/clang/tools/dxcompiler/dxcompilerobj.cpp

@@ -561,8 +561,6 @@ public:
 
 
       StringRef Data((LPSTR)utf8Source->GetBufferPointer(),
       StringRef Data((LPSTR)utf8Source->GetBufferPointer(),
                      utf8Source->GetBufferSize());
                      utf8Source->GetBufferSize());
-      std::unique_ptr<llvm::MemoryBuffer> pBuffer(
-          llvm::MemoryBuffer::getMemBufferCopy(Data, pUtf8SourceName));
 
 
       // Not very efficient but also not very important.
       // Not very efficient but also not very important.
       std::vector<std::string> defines;
       std::vector<std::string> defines;
@@ -886,8 +884,6 @@ public:
 
 
       StringRef Data((LPSTR)utf8Source->GetBufferPointer(),
       StringRef Data((LPSTR)utf8Source->GetBufferPointer(),
         utf8Source->GetBufferSize());
         utf8Source->GetBufferSize());
-      std::unique_ptr<llvm::MemoryBuffer> pBuffer(
-        llvm::MemoryBuffer::getMemBufferCopy(Data, pUtf8SourceName));
 
 
       // Not very efficient but also not very important.
       // Not very efficient but also not very important.
       std::vector<std::string> defines;
       std::vector<std::string> defines;

+ 7 - 1
tools/clang/unittests/HLSL/CompilerTest.cpp

@@ -234,7 +234,13 @@ public:
 
 
 #if _ITERATOR_DEBUG_LEVEL==0 
 #if _ITERATOR_DEBUG_LEVEL==0 
   // CompileWhenNoMemThenOOM can properly detect leaks only when debug iterators are disabled
   // CompileWhenNoMemThenOOM can properly detect leaks only when debug iterators are disabled
-  TEST_METHOD(CompileWhenNoMemThenOOM)
+  BEGIN_TEST_METHOD(CompileWhenNoMemThenOOM)
+    // Disabled because there are problems where we try to allocate memory in destructors,
+    // which causes more bad_alloc() throws while unwinding bad_alloc(), which asserts
+    // If only failing one allocation, there are allocations where failing them is lost,
+    // such as in ~raw_string_ostream(), where it flushes, then eats bad_alloc(), if thrown.
+    TEST_METHOD_PROPERTY(L"Ignore", L"true")
+  END_TEST_METHOD()
 #endif
 #endif
   TEST_METHOD(CompileWhenShaderModelMismatchAttributeThenFail)
   TEST_METHOD(CompileWhenShaderModelMismatchAttributeThenFail)
   TEST_METHOD(CompileBadHlslThenFail)
   TEST_METHOD(CompileBadHlslThenFail)