aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/PCHReader.cpp
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-11-11 23:58:53 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-11-11 23:58:53 +0000
commitc7162937a4ccd044a0df67eed4a73ee828c49162 (patch)
treedd3b9b98bef7debfbb2144fcbc34ca571be78189 /lib/Frontend/PCHReader.cpp
parent6a6742a8fc3b056e057e8eb34084e3ecc8f028af (diff)
Tweak PCH -include handling to make sure it matches the name as would be present
in the predefines buffer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@86903 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Frontend/PCHReader.cpp')
-rw-r--r--lib/Frontend/PCHReader.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Frontend/PCHReader.cpp b/lib/Frontend/PCHReader.cpp
index 936382482c..780890de2a 100644
--- a/lib/Frontend/PCHReader.cpp
+++ b/lib/Frontend/PCHReader.cpp
@@ -13,6 +13,7 @@
#include "clang/Frontend/PCHReader.h"
#include "clang/Frontend/FrontendDiagnostic.h"
+#include "clang/Frontend/Utils.h"
#include "../Sema/Sema.h" // FIXME: move Sema headers elsewhere
#include "clang/AST/ASTConsumer.h"
#include "clang/AST/ASTContext.h"
@@ -158,12 +159,13 @@ bool PCHValidator::ReadPredefinesBuffer(llvm::StringRef PCHPredef,
FileID PCHBufferID,
llvm::StringRef OriginalFileName,
std::string &SuggestedPredefines) {
- // We are in the context of an implicit include, so the predefines buffer
- // will have a #include entry for the PCH file itself. Find it and skip over
- // it in the checking below.
+ // We are in the context of an implicit include, so the predefines buffer will
+ // have a #include entry for the PCH file itself (as normalized by the
+ // preprocessor initialization). Find it and skip over it in the checking
+ // below.
llvm::SmallString<256> PCHInclude;
PCHInclude += "#include \"";
- PCHInclude += OriginalFileName;
+ PCHInclude += NormalizeDashIncludePath(OriginalFileName);
PCHInclude += "\"\n";
std::pair<llvm::StringRef,llvm::StringRef> Split =
llvm::StringRef(PP.getPredefines()).split(PCHInclude.str());