aboutsummaryrefslogtreecommitdiff
path: root/tools/driver/driver.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-12-25 21:56:27 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-12-25 21:56:27 +0000
commita57b3b4fea1c962678972af8fc74e121ff8b296d (patch)
tree73ed6f071b2807694ed4f4b60c469ddefb515b98 /tools/driver/driver.cpp
parent65d78312ce026092cb6e7b1d4d06f05e18d02aa0 (diff)
Produce an actual error before attempting to attach notes to it when bailing out
due to FORCE_CLANG_DIAGNOSTICS_CRASH=1. Also add a test for that env var. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171074 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/driver/driver.cpp')
-rw-r--r--tools/driver/driver.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/tools/driver/driver.cpp b/tools/driver/driver.cpp
index 353d06fb14..de2b899bfa 100644
--- a/tools/driver/driver.cpp
+++ b/tools/driver/driver.cpp
@@ -16,6 +16,7 @@
#include "clang/Driver/ArgList.h"
#include "clang/Driver/Compilation.h"
#include "clang/Driver/Driver.h"
+#include "clang/Driver/DriverDiagnostic.h"
#include "clang/Driver/OptTable.h"
#include "clang/Driver/Option.h"
#include "clang/Driver/Options.h"
@@ -470,8 +471,10 @@ int main(int argc_, const char **argv_) {
Res = TheDriver.ExecuteCompilation(*C, FailingCommand);
// Force a crash to test the diagnostics.
- if(::getenv("FORCE_CLANG_DIAGNOSTICS_CRASH"))
- Res = -1;
+ if (::getenv("FORCE_CLANG_DIAGNOSTICS_CRASH")) {
+ Diags.Report(diag::err_drv_force_crash) << "FORCE_CLANG_DIAGNOSTICS_CRASH";
+ Res = -1;
+ }
// If result status is < 0, then the driver command signalled an error.
// If result status is 70, then the driver command reported a fatal error.