summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 9e07e747e87..822b44e442c 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -621,7 +621,7 @@ bool CompilerInstance::InitializeSourceManager(const FrontendInputFile &Input,
Kind = Input.isSystem() ? SrcMgr::C_System : SrcMgr::C_User;
if (Input.isBuffer()) {
- SourceMgr.createMainFileIDForMemBuffer(Input.getBuffer(), Kind);
+ SourceMgr.setMainFileID(SourceMgr.createFileID(Input.getBuffer(), Kind));
assert(!SourceMgr.getMainFileID().isInvalid() &&
"Couldn't establish MainFileID!");
return true;
@@ -655,7 +655,8 @@ bool CompilerInstance::InitializeSourceManager(const FrontendInputFile &Input,
}
}
- SourceMgr.createMainFileID(File, Kind);
+ SourceMgr.setMainFileID(
+ SourceMgr.createFileID(File, SourceLocation(), Kind));
} else {
std::unique_ptr<llvm::MemoryBuffer> SB;
if (llvm::error_code ec = llvm::MemoryBuffer::getSTDIN(SB)) {
@@ -664,7 +665,8 @@ bool CompilerInstance::InitializeSourceManager(const FrontendInputFile &Input,
}
const FileEntry *File = FileMgr.getVirtualFile(SB->getBufferIdentifier(),
SB->getBufferSize(), 0);
- SourceMgr.createMainFileID(File, Kind);
+ SourceMgr.setMainFileID(
+ SourceMgr.createFileID(File, SourceLocation(), Kind));
SourceMgr.overrideFileContents(File, SB.release());
}
OpenPOWER on IntegriCloud