summaryrefslogtreecommitdiffstats
path: root/clang/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
commit9afd449e8ff4382d9479cfbc7acc38d74fbcfc76 (patch)
tree0330af5b9aa30c4be2765f8144af26ae77f17a0f /clang/lib/Frontend/FrontendAction.cpp
parent7e325789af12aa3b933b7f7b1176805b4e1997de (diff)
downloadbcm5719-llvm-9afd449e8ff4382d9479cfbc7acc38d74fbcfc76.tar.gz
bcm5719-llvm-9afd449e8ff4382d9479cfbc7acc38d74fbcfc76.zip
When loading an AST file, set SourceManager::MainFileID to the main file of the AST file,
as suggested by Tom Honermann. llvm-svn: 147612
Diffstat (limited to 'clang/lib/Frontend/FrontendAction.cpp')
-rw-r--r--clang/lib/Frontend/FrontendAction.cpp11
1 files changed, 1 insertions, 10 deletions
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp
index 6ef07c447da..7e4ae023d0e 100644
--- a/clang/lib/Frontend/FrontendAction.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud