diff options
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Driver/ArgList.cpp | 9 | ||||
-rw-r--r-- | clang/lib/Driver/Tools.cpp | 8 |
2 files changed, 17 insertions, 0 deletions
diff --git a/clang/lib/Driver/ArgList.cpp b/clang/lib/Driver/ArgList.cpp index 6d19f1acc59..69cb85b7fc3 100644 --- a/clang/lib/Driver/ArgList.cpp +++ b/clang/lib/Driver/ArgList.cpp @@ -140,6 +140,15 @@ void ArgList::AddAllArgsTranslated(ArgStringList &Output, options::ID Id0, } } +void ArgList::ClaimAllArgs(options::ID Id0) const { + // FIXME: Make fast. + for (const_iterator it = begin(), ie = end(); it != ie; ++it) { + const Arg *A = *it; + if (A->getOption().matches(Id0)) + A->claim(); + } +} + // InputArgList::InputArgList(const char **ArgBegin, const char **ArgEnd) diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index 16677439e9d..70daaf5a62f 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -415,6 +415,14 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA, Args.MakeArgString(getToolChain().GetProgramPath(C, "clang-cc").c_str()); Dest.addCommand(new Command(Exec, CmdArgs)); + // Claim some arguments which clang supports automatically. + + // -fpch-preprocess is used with gcc to add a special marker in the + // -output to include the PCH file. Clang's PTH solution is + // -completely transparent, so we do not need to deal with it at + // -all. + Args.ClaimAllArgs(options::OPT_fpch_preprocess); + // Claim some arguments which clang doesn't support, but we don't // care to warn the user about. |