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 | 46e3908af1ba2af6d7497e8e501f5c9a01acde7e (patch) | |
tree | 4535753eebde824f909e491352916b6a441e69bb /lib/Driver/Driver.cpp | |
parent | 4019f7d384ab0d993ffd345f38ff0fa3a84e750b (diff) |
[driver] When clang crashes, don't try to generate diagnostics (i.e.,
preprocessor output) with multiple -arch options.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139207 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Driver/Driver.cpp')
-rw-r--r-- | lib/Driver/Driver.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/Driver/Driver.cpp b/lib/Driver/Driver.cpp index bb01859588..0f373b3729 100644 --- a/lib/Driver/Driver.cpp +++ b/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."; |