summaryrefslogtreecommitdiffstats
path: root/tools/driver
diff options
context:
space:
mode:
authorChad Rosier <mcrosier@apple.com>2011-08-02 17:58:04 +0000
committerChad Rosier <mcrosier@apple.com>2011-08-02 17:58:04 +0000
commit2b81910618f63e4ce2373c926a26e76b4b91373f (patch)
tree48cef925cb1f3b951d23d5e7edea779d5505c6c1 /tools/driver
parentc24a1eef40207457692a1ad597cefdd0dc8fa149 (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. rdar://9575623 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136702 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/driver')
-rw-r--r--tools/driver/driver.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/driver/driver.cpp b/tools/driver/driver.cpp
index 096260c421..3ae1487118 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());