summaryrefslogtreecommitdiff
path: root/contrib/llvm/tools/clang/lib/Frontend/FrontendAction.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2017-12-20 14:26:54 +0000
committerDimitry Andric <dim@FreeBSD.org>2017-12-20 14:26:54 +0000
commit9a199699c2fd227dae8c1ff60a70c819e9d4fdfe (patch)
tree1953a1b292c4637ca2a5ede1494d3a5b84cccac3 /contrib/llvm/tools/clang/lib/Frontend/FrontendAction.cpp
parent2cab237b5dbfe1b3e9c7aa7a3c02d2b98fcf7462 (diff)
parent461a67fa15370a9ec88f8f8a240bf7c123bb2029 (diff)
Notes
Diffstat (limited to 'contrib/llvm/tools/clang/lib/Frontend/FrontendAction.cpp')
-rw-r--r--contrib/llvm/tools/clang/lib/Frontend/FrontendAction.cpp23
1 files changed, 9 insertions, 14 deletions
diff --git a/contrib/llvm/tools/clang/lib/Frontend/FrontendAction.cpp b/contrib/llvm/tools/clang/lib/Frontend/FrontendAction.cpp
index 704d51509851..12226b231417 100644
--- a/contrib/llvm/tools/clang/lib/Frontend/FrontendAction.cpp
+++ b/contrib/llvm/tools/clang/lib/Frontend/FrontendAction.cpp
@@ -633,18 +633,12 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI,
return true;
}
- if (!CI.hasVirtualFileSystem()) {
- if (IntrusiveRefCntPtr<vfs::FileSystem> VFS =
- createVFSFromCompilerInvocation(CI.getInvocation(),
- CI.getDiagnostics()))
- CI.setVirtualFileSystem(VFS);
- else
+ // Set up the file and source managers, if needed.
+ if (!CI.hasFileManager()) {
+ if (!CI.createFileManager()) {
goto failure;
+ }
}
-
- // Set up the file and source managers, if needed.
- if (!CI.hasFileManager())
- CI.createFileManager();
if (!CI.hasSourceManager())
CI.createSourceManager(CI.getFileManager());
@@ -754,10 +748,11 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI,
goto failure;
// Reinitialize the main file entry to refer to the new input.
- if (!CI.InitializeSourceManager(FrontendInputFile(
- Buffer.release(), Input.getKind().withFormat(InputKind::Source),
- CurrentModule->IsSystem)))
- goto failure;
+ auto Kind = CurrentModule->IsSystem ? SrcMgr::C_System : SrcMgr::C_User;
+ auto &SourceMgr = CI.getSourceManager();
+ auto BufferID = SourceMgr.createFileID(std::move(Buffer), Kind);
+ assert(BufferID.isValid() && "couldn't creaate module buffer ID");
+ SourceMgr.setMainFileID(BufferID);
}
}