diff options
| author | Hans Wennborg <hans@hanshq.net> | 2014-06-11 19:44:53 +0000 |
|---|---|---|
| committer | Hans Wennborg <hans@hanshq.net> | 2014-06-11 19:44:53 +0000 |
| commit | 8f0083711019ea0e4e360bdc6156073525fed44a (patch) | |
| tree | da5be3f693bf7684d171edc3c594ad89f9eca088 /clang/lib/Driver/Tools.cpp | |
| parent | 5235803e678f2374225439664cf5ea0176fcc454 (diff) | |
| download | bcm5719-llvm-8f0083711019ea0e4e360bdc6156073525fed44a.tar.gz bcm5719-llvm-8f0083711019ea0e4e360bdc6156073525fed44a.zip | |
clang-cl: accept the /C option with /P (PR19978)
(It's also allowed with /EP, but we haven't implemented that option yet.)
llvm-svn: 210695
Diffstat (limited to 'clang/lib/Driver/Tools.cpp')
| -rw-r--r-- | clang/lib/Driver/Tools.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp index dfbc280c55c..9d8356a8f77 100644 --- a/clang/lib/Driver/Tools.cpp +++ b/clang/lib/Driver/Tools.cpp @@ -63,10 +63,14 @@ static void addAssemblerKPIC(const ArgList &Args, ArgStringList &CmdArgs) { /// CheckPreprocessingOptions - Perform some validation of preprocessing /// arguments that is shared with gcc. static void CheckPreprocessingOptions(const Driver &D, const ArgList &Args) { - if (Arg *A = Args.getLastArg(options::OPT_C, options::OPT_CC)) - if (!Args.hasArg(options::OPT_E) && !D.CCCIsCPP()) + if (Arg *A = Args.getLastArg(options::OPT_C, options::OPT_CC)) { + if (!Args.hasArg(options::OPT_E) && !Args.hasArg(options::OPT__SLASH_P) && + !Args.hasArg(options::OPT__SLASH_EP) && !D.CCCIsCPP()) { D.Diag(diag::err_drv_argument_only_allowed_with) - << A->getAsString(Args) << "-E"; + << A->getBaseArg().getAsString(Args) + << (D.IsCLMode() ? "/E, /P or /EP" : "-E"); + } + } } /// CheckCodeGenerationOptions - Perform some validation of code generation |

