diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-11-11 23:58:53 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-11-11 23:58:53 +0000 |
commit | 732ef8aefd67ac12f73c35c05280d1f82d342eb7 (patch) | |
tree | a7b6b0371ad2af81da00a2ffbe2f3e8d940f61ea /clang/lib/Frontend/InitPreprocessor.cpp | |
parent | 7a6b11e70762d02a7526790a54fd205ae3f420ba (diff) | |
download | bcm5719-llvm-732ef8aefd67ac12f73c35c05280d1f82d342eb7.tar.gz bcm5719-llvm-732ef8aefd67ac12f73c35c05280d1f82d342eb7.zip |
Tweak PCH -include handling to make sure it matches the name as would be present
in the predefines buffer.
llvm-svn: 86903
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r-- | clang/lib/Frontend/InitPreprocessor.cpp | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp index ad70727c05e..462e065e8c1 100644 --- a/clang/lib/Frontend/InitPreprocessor.cpp +++ b/clang/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('"'); } |