Skip to content

Commit 28499c6

Browse files
jeffnnJeff Noyle
andauthored
autofilesys (#3120)
Co-authored-by: Jeff Noyle <[email protected]>
1 parent e3a8344 commit 28499c6

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

tools/clang/tools/dxcompiler/dxcassembler.cpp

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,9 +17,11 @@
1717
#include "dxc/Support/FileIOHelper.h"
1818
#include "dxc/DXIL/DxilModule.h"
1919
#include "dxc/Support/dxcapi.impl.h"
20+
#include "dxc/Support/dxcfilesystem.h"
2021
#include "dxillib.h"
2122
#include "dxcutil.h"
2223

24+
#include "llvm/Support/FileSystem.h"
2325
#include "llvm/Support/MemoryBuffer.h"
2426
#include "llvm/IRReader/IRReader.h"
2527
#include "llvm/Bitcode/ReaderWriter.h"
@@ -73,6 +75,11 @@ HRESULT STDMETHODCALLTYPE DxcAssembler::AssembleToContainer(
7375
HRESULT hr = S_OK;
7476
DxcThreadMalloc TM(m_pMalloc);
7577
try {
78+
::llvm::sys::fs::MSFileSystem *msfPtr;
79+
IFT(CreateMSFileSystemForDisk(&msfPtr));
80+
std::unique_ptr<::llvm::sys::fs::MSFileSystem> msf(msfPtr);
81+
::llvm::sys::fs::AutoPerThreadSystem pts(msf.get());
82+
7683
// Setup input buffer.
7784
// The ir parsing requires the buffer to be null terminated. We deal with
7885
// both source and bitcode input, so the input buffer may not be null terminated.

0 commit comments

Comments
 (0)