diff options
author | Chad Rosier <mcrosier@apple.com> | 2011-09-06 23:52:36 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2011-09-06 23:52:36 +0000 |
commit | e75ef40843e486f595465f763aaa9714382fc897 (patch) | |
tree | ee4a485baaecb2588978678c6520c40311d89dcb /clang/lib | |
parent | 226c4ed92aaca04e1cac1d6d61de621d2ffb45aa (diff) | |
download | bcm5719-llvm-e75ef40843e486f595465f763aaa9714382fc897.tar.gz bcm5719-llvm-e75ef40843e486f595465f763aaa9714382fc897.zip |
[driver] When clang crashes, don't try to generate diagnostics (i.e.,
preprocessor output) with multiple -arch options.
llvm-svn: 139207
Diffstat (limited to 'clang/lib')
-rw-r--r-- | clang/lib/Driver/Driver.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/clang/lib/Driver/Driver.cpp b/clang/lib/Driver/Driver.cpp index bb018595882..0f373b37298 100644 --- a/clang/lib/Driver/Driver.cpp +++ b/clang/lib/Driver/Driver.cpp @@ -396,6 +396,23 @@ void Driver::generateCompilationDiagnostics(Compilation &C, } } + // Don't attempt to generate preprocessed files if multiple -arch options are + // used. + int Archs = 0; + for (ArgList::const_iterator it = C.getArgs().begin(), ie = C.getArgs().end(); + it != ie; ++it) { + Arg *A = *it; + if (A->getOption().matches(options::OPT_arch)) { + Archs++; + if (Archs > 1) { + Diag(clang::diag::note_drv_command_failed_diag_msg) + << "Error generating preprocessed source(s) - cannot generate " + "preprocessed source with multiple -arch options."; + return; + } + } + } + if (Inputs.empty()) { Diag(clang::diag::note_drv_command_failed_diag_msg) << "Error generating preprocessed source(s) - no preprocessable inputs."; |