aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/InitPreprocessor.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/InitPreprocessor.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/InitPreprocessor.cpp')
-rw-r--r--lib/Frontend/InitPreprocessor.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/lib/Frontend/InitPreprocessor.cpp b/lib/Frontend/InitPreprocessor.cpp
index ad70727c05..462e065e8c 100644
--- a/lib/Frontend/InitPreprocessor.cpp
+++ b/lib/Frontend/InitPreprocessor.cpp
@@ -61,9 +61,7 @@ static void UndefineBuiltinMacro(std::vector<char> &Buf, const char *Macro) {
Buf.push_back('\n');
}
-/// Add the quoted name of an implicit include file.
-static void AddQuotedIncludePath(std::vector<char> &Buf,
- const std::string &File) {
+std::string clang::NormalizeDashIncludePath(llvm::StringRef File) {
// Implicit include paths should be resolved relative to the current
// working directory first, and then use the regular header search
// mechanism. The proper way to handle this is to have the
@@ -76,9 +74,16 @@ static void AddQuotedIncludePath(std::vector<char> &Buf,
if (!Path.exists())
Path = File;
+ return Lexer::Stringify(Path.str());
+}
+
+/// Add the quoted name of an implicit include file.
+static void AddQuotedIncludePath(std::vector<char> &Buf,
+ const std::string &File) {
+
// Escape double quotes etc.
Buf.push_back('"');
- std::string EscapedFile = Lexer::Stringify(Path.str());
+ std::string EscapedFile = NormalizeDashIncludePath(File);
Buf.insert(Buf.end(), EscapedFile.begin(), EscapedFile.end());
Buf.push_back('"');
}