diff options
author | Chad Rosier <mcrosier@apple.com> | 2011-07-20 20:26:32 +0000 |
---|---|---|
committer | Chad Rosier <mcrosier@apple.com> | 2011-07-20 20:26:32 +0000 |
commit | 2da13b15959365df7edf1ed12a049b599b39c276 (patch) | |
tree | 9ae0d63ccefc306b330032a070310175e4589f70 /tools/driver/driver.cpp | |
parent | 66488ed140f00daee0c3f0370bac337819ee8bc0 (diff) |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135614 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/driver/driver.cpp')
-rw-r--r-- | tools/driver/driver.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/driver/driver.cpp b/tools/driver/driver.cpp index ca8982619e..b2f65c9288 100644 --- a/tools/driver/driver.cpp +++ b/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()); |