summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-03-09 17:21:42 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-03-09 17:21:42 +0000
commit35dcda792241569a65db70e555b6dd50c332898b (patch)
treec137163265cbefe585ddbdda6a3fd6a644f212a0 /clang/lib/Frontend/CompilerInvocation.cpp
parent709b108ae117092d7d6a2c4abcd8f65918db81e3 (diff)
downloadbcm5719-llvm-35dcda792241569a65db70e555b6dd50c332898b.tar.gz
bcm5719-llvm-35dcda792241569a65db70e555b6dd50c332898b.zip
Introduce '-chain-include' option to specify headers that will be converted to chained PCHs in memory
without having to use multiple runs and intermediate files. Intended for testing & debugging of chained PCH. llvm-svn: 127339
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInvocation.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInvocation.cpp b/clang/lib/Frontend/CompilerInvocation.cpp
index 8f994039235..d8de7c08b48 100644
--- a/clang/lib/Frontend/CompilerInvocation.cpp
+++ b/clang/lib/Frontend/CompilerInvocation.cpp
@@ -704,6 +704,10 @@ static void PreprocessorOptsToArgs(const PreprocessorOptions &Opts,
assert(Opts.ImplicitPTHInclude == Opts.TokenCache &&
"Unsupported option combination!");
}
+ for (unsigned i = 0, e = Opts.ChainedIncludes.size(); i != e; ++i) {
+ Res.push_back("-chain-include");
+ Res.push_back(Opts.ChainedIncludes[i]);
+ }
for (unsigned i = 0, e = Opts.RemappedFiles.size(); i != e; ++i) {
Res.push_back("-remap-file");
Res.push_back(Opts.RemappedFiles[i].first + ";" +
@@ -1562,6 +1566,12 @@ static void ParsePreprocessorArgs(PreprocessorOptions &Opts, ArgList &Args,
Opts.Includes.push_back(A->getValue(Args));
}
+ for (arg_iterator it = Args.filtered_begin(OPT_chain_include),
+ ie = Args.filtered_end(); it != ie; ++it) {
+ const Arg *A = *it;
+ Opts.ChainedIncludes.push_back(A->getValue(Args));
+ }
+
// Include 'altivec.h' if -faltivec option present
if (Args.hasArg(OPT_faltivec))
Opts.Includes.push_back("altivec.h");
OpenPOWER on IntegriCloud