summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/InitPreprocessor.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-02-05 16:36:52 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2013-02-05 16:36:52 +0000
commit48b72d81c8968f3d342557582db986a60aef2c54 (patch)
tree06af75dac2898c6c3a52ed3132d9facb80921462 /clang/lib/Frontend/InitPreprocessor.cpp
parentb76de88288b32ce192a03cd7b387bf0137fbd436 (diff)
downloadbcm5719-llvm-48b72d81c8968f3d342557582db986a60aef2c54.tar.gz
bcm5719-llvm-48b72d81c8968f3d342557582db986a60aef2c54.zip
[frontend] Don't put a PCH/PTH filename into the set of includes in the preprocessor options;
since only one of them is allowed in command-line, process them separately. Otherwise, if more than one is specified in the command-line, one is processed normally and the others are going to be treated and included as header files. Related to radar://13140508 llvm-svn: 174385
Diffstat (limited to 'clang/lib/Frontend/InitPreprocessor.cpp')
-rw-r--r--clang/lib/Frontend/InitPreprocessor.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/clang/lib/Frontend/InitPreprocessor.cpp b/clang/lib/Frontend/InitPreprocessor.cpp
index 3646e27a491..b74c3c0b1c1 100644
--- a/clang/lib/Frontend/InitPreprocessor.cpp
+++ b/clang/lib/Frontend/InitPreprocessor.cpp
@@ -784,15 +784,16 @@ void clang::InitializePreprocessor(Preprocessor &PP,
AddImplicitIncludeMacros(Builder, InitOpts.MacroIncludes[i],
PP.getFileManager());
+ // Process -include-pch/-include-pth directives.
+ if (!InitOpts.ImplicitPCHInclude.empty())
+ AddImplicitIncludePCH(Builder, PP, InitOpts.ImplicitPCHInclude);
+ if (!InitOpts.ImplicitPTHInclude.empty())
+ AddImplicitIncludePTH(Builder, PP, InitOpts.ImplicitPTHInclude);
+
// Process -include directives.
for (unsigned i = 0, e = InitOpts.Includes.size(); i != e; ++i) {
const std::string &Path = InitOpts.Includes[i];
- if (Path == InitOpts.ImplicitPTHInclude)
- AddImplicitIncludePTH(Builder, PP, Path);
- else if (Path == InitOpts.ImplicitPCHInclude)
- AddImplicitIncludePCH(Builder, PP, Path);
- else
- AddImplicitInclude(Builder, Path, PP.getFileManager());
+ AddImplicitInclude(Builder, Path, PP.getFileManager());
}
// Exit the command line and go back to <built-in> (2 is LC_LEAVE).
OpenPOWER on IntegriCloud