summaryrefslogtreecommitdiffstats
path: root/clang/tools/driver/driver.cpp
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2011-07-20 20:26:32 +0000
committerChad Rosier <mcrosier@apple.com>2011-07-20 20:26:32 +0000
commite3805fc118216cb467a03d6890eb1fb9b06a8628 (patch)
tree475cf801adf24e293a0e0f2f93da3c882a3361bf /clang/tools/driver/driver.cpp
parente6f7f914db4ae4ca75a30fc2064cafe0c46fcf67 (diff)
downloadbcm5719-llvm-e3805fc118216cb467a03d6890eb1fb9b06a8628.tar.gz
bcm5719-llvm-e3805fc118216cb467a03d6890eb1fb9b06a8628.zip
When the compiler crashes, the compiler driver now produces diagnostic information
including the fully preprocessed source file(s) and command line arguments. The developer is asked to attach this diagnostic information to a bug report. llvm-svn: 135614
Diffstat (limited to 'clang/tools/driver/driver.cpp')
-rw-r--r--clang/tools/driver/driver.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/clang/tools/driver/driver.cpp b/clang/tools/driver/driver.cpp
index ca8982619e9..b2f65c92884 100644
--- a/clang/tools/driver/driver.cpp
+++ b/clang/tools/driver/driver.cpp
@@ -458,9 +458,15 @@ int main(int argc_, const char **argv_) {
llvm::OwningPtr<Compilation> C(TheDriver.BuildCompilation(argv));
int Res = 0;
+ const Command *FailingCommand = 0;
if (C.get())
- Res = TheDriver.ExecuteCompilation(*C);
-
+ Res = TheDriver.ExecuteCompilation(*C, FailingCommand);
+
+ // If result status is < 0, then the driver command signalled an error.
+ // In this case, generate additional diagnostic information if possible.
+ if (Res < 0)
+ TheDriver.generateCompilationDiagnostics(*C, FailingCommand);
+
// If any timers were active but haven't been destroyed yet, print their
// results now. This happens in -disable-free mode.
llvm::TimerGroup::printAll(llvm::errs());
OpenPOWER on IntegriCloud