aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/FrontendAction.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-01-05 21:36:25 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2012-01-05 21:36:25 +0000
commitb8c879a5363f36bdae8831112b563333e3c05acb (patch)
treecfd0b285fc1a8ec98b29a7f339d040afc8b7e44d /lib/Frontend/FrontendAction.cpp
parentcb7709c06027448c754dd03e2e521d82d04818bf (diff)
When loading an AST file, set SourceManager::MainFileID to the main file of the AST file,
as suggested by Tom Honermann. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@147612 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/FrontendAction.cpp')
-rw-r--r--lib/Frontend/FrontendAction.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/lib/Frontend/FrontendAction.cpp b/lib/Frontend/FrontendAction.cpp
index 6ef07c447d..7e4ae023d0 100644
--- a/lib/Frontend/FrontendAction.cpp
+++ b/lib/Frontend/FrontendAction.cpp
@@ -310,16 +310,7 @@ void FrontendAction::Execute() {
// Initialize the main file entry. This needs to be delayed until after PCH
// has loaded.
- if (isCurrentFileAST()) {
- // Set the main file ID to an empty file.
- //
- // FIXME: We probably shouldn't need this, but for now this is the
- // simplest way to reuse the logic in ParseAST.
- const char *EmptyStr = "";
- llvm::MemoryBuffer *SB =
- llvm::MemoryBuffer::getMemBuffer(EmptyStr, "<dummy input>");
- CI.getSourceManager().createMainFileIDForMemBuffer(SB);
- } else {
+ if (!isCurrentFileAST()) {
if (!CI.InitializeSourceManager(getCurrentFile()))
return;
}