mirror of
https://github.com/MaskRay/ccls.git
synced 2024-11-28 02:21:57 +00:00
Adapt clang rC357037: removal of setVirtualFileSystem
This commit is contained in:
parent
0846c12e89
commit
a41b976a77
@ -1251,12 +1251,17 @@ Index(SemaManager *manager, WorkingFiles *wfiles, VFS *vfs,
|
|||||||
DiagnosticConsumer DC;
|
DiagnosticConsumer DC;
|
||||||
auto Clang = std::make_unique<CompilerInstance>(PCH);
|
auto Clang = std::make_unique<CompilerInstance>(PCH);
|
||||||
Clang->setInvocation(std::move(CI));
|
Clang->setInvocation(std::move(CI));
|
||||||
Clang->setVirtualFileSystem(FS);
|
|
||||||
Clang->createDiagnostics(&DC, false);
|
Clang->createDiagnostics(&DC, false);
|
||||||
Clang->setTarget(TargetInfo::CreateTargetInfo(
|
Clang->setTarget(TargetInfo::CreateTargetInfo(
|
||||||
Clang->getDiagnostics(), Clang->getInvocation().TargetOpts));
|
Clang->getDiagnostics(), Clang->getInvocation().TargetOpts));
|
||||||
if (!Clang->hasTarget())
|
if (!Clang->hasTarget())
|
||||||
return {};
|
return {};
|
||||||
|
#if LLVM_VERSION_MAJOR >= 9 // rC357037
|
||||||
|
Clang->createFileManager(FS);
|
||||||
|
#else
|
||||||
|
Clang->setVirtualFileSystem(FS);
|
||||||
|
Clang->createFileManager();
|
||||||
|
#endif
|
||||||
|
|
||||||
IndexParam param(*vfs, no_linkage);
|
IndexParam param(*vfs, no_linkage);
|
||||||
auto DataConsumer = std::make_shared<IndexDataConsumer>(param);
|
auto DataConsumer = std::make_shared<IndexDataConsumer>(param);
|
||||||
|
@ -308,7 +308,6 @@ std::unique_ptr<CompilerInstance> BuildCompilerInstance(
|
|||||||
|
|
||||||
auto Clang = std::make_unique<CompilerInstance>(session.PCH);
|
auto Clang = std::make_unique<CompilerInstance>(session.PCH);
|
||||||
Clang->setInvocation(std::move(CI));
|
Clang->setInvocation(std::move(CI));
|
||||||
Clang->setVirtualFileSystem(FS);
|
|
||||||
Clang->createDiagnostics(&DC, false);
|
Clang->createDiagnostics(&DC, false);
|
||||||
Clang->setTarget(TargetInfo::CreateTargetInfo(
|
Clang->setTarget(TargetInfo::CreateTargetInfo(
|
||||||
Clang->getDiagnostics(), Clang->getInvocation().TargetOpts));
|
Clang->getDiagnostics(), Clang->getInvocation().TargetOpts));
|
||||||
@ -317,7 +316,12 @@ std::unique_ptr<CompilerInstance> BuildCompilerInstance(
|
|||||||
// Construct SourceManager with UserFilesAreVolatile: true because otherwise
|
// Construct SourceManager with UserFilesAreVolatile: true because otherwise
|
||||||
// RequiresNullTerminator: true may cause out-of-bounds read when a file is
|
// RequiresNullTerminator: true may cause out-of-bounds read when a file is
|
||||||
// mmap'ed but is saved concurrently.
|
// mmap'ed but is saved concurrently.
|
||||||
|
#if LLVM_VERSION_MAJOR >= 9 // rC357037
|
||||||
|
Clang->createFileManager(FS);
|
||||||
|
#else
|
||||||
|
Clang->setVirtualFileSystem(FS);
|
||||||
Clang->createFileManager();
|
Clang->createFileManager();
|
||||||
|
#endif
|
||||||
Clang->setSourceManager(new SourceManager(Clang->getDiagnostics(),
|
Clang->setSourceManager(new SourceManager(Clang->getDiagnostics(),
|
||||||
Clang->getFileManager(), true));
|
Clang->getFileManager(), true));
|
||||||
auto &IS = Clang->getFrontendOpts().Inputs;
|
auto &IS = Clang->getFrontendOpts().Inputs;
|
||||||
|
Loading…
Reference in New Issue
Block a user