소스 검색

Fix per-thread file system in opt.exe for testing

Tex Riddell 7 년 전
부모
커밋
c25719477e
1개의 변경된 파일5개의 추가작업 그리고 0개의 파일을 삭제
  1. 5 0
      tools/opt/opt.cpp

+ 5 - 0
tools/opt/opt.cpp

@@ -301,6 +301,11 @@ void initializePollyPasses(llvm::PassRegistry &Registry);
 // HLSL Change: changed calling convention to __cdecl
 int __cdecl main(int argc, char **argv) {
   // HLSL Change Starts
+  if (llvm::sys::fs::SetupPerThreadFileSystem())
+    return 1;
+  llvm::sys::fs::AutoCleanupPerThreadFileSystem auto_cleanup_fs;
+  if (FAILED(DxcInitThreadMalloc())) return 1;
+  DxcSetThreadMallocOrDefault(nullptr);
   llvm::sys::fs::MSFileSystem* msfPtr;
   if (FAILED(CreateMSFileSystemForDisk(&msfPtr))) return 1;
   std::unique_ptr<llvm::sys::fs::MSFileSystem> msf(msfPtr);