Skip to content

Commit 56ee8be

Browse files
committed
Fix null file system as calling CodeCompleteAt
1 parent 5275deb commit 56ee8be

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

tools/clang/tools/libclang/dxcisenseimpl.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1625,6 +1625,12 @@ HRESULT DxcTranslationUnit::CodeCompleteAt(const char *fileName, unsigned line,
16251625
if (FAILED(hr))
16261626
return hr;
16271627

1628+
::llvm::sys::fs::MSFileSystem *msfPtr;
1629+
IFT(CreateMSFileSystemForDisk(&msfPtr));
1630+
std::unique_ptr<::llvm::sys::fs::MSFileSystem> msf(msfPtr);
1631+
1632+
::llvm::sys::fs::AutoPerThreadSystem pts(msf.get());
1633+
IFTLLVM(pts.error_code());
16281634
CXCodeCompleteResults *results = clang_codeCompleteAt(
16291635
m_tu, fileName, line, column, files, numUnsavedFiles, options);
16301636

0 commit comments

Comments
 (0)