[cfe-commits] r155205 - in /cfe/trunk: lib/Driver/Driver.cpp tools/driver/driver.cpp
Chad Rosier
mcrosier at apple.com
Fri Apr 20 10:08:59 PDT 2012
Author: mcrosier
Date: Fri Apr 20 12:08:59 2012
New Revision: 155205
URL: http://llvm.org/viewvc/llvm-project?rev=155205&view=rev
Log:
Add a little hack to emulate a clang crash, so the diagnostics generator can be
tested.
Modified:
cfe/trunk/lib/Driver/Driver.cpp
cfe/trunk/tools/driver/driver.cpp
Modified: cfe/trunk/lib/Driver/Driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Driver/Driver.cpp?rev=155205&r1=155204&r2=155205&view=diff
==============================================================================
--- cfe/trunk/lib/Driver/Driver.cpp (original)
+++ cfe/trunk/lib/Driver/Driver.cpp Fri Apr 20 12:08:59 2012
@@ -379,7 +379,7 @@
return;
// Don't try to generate diagnostics for link jobs.
- if (FailingCommand->getCreator().isLinkJob())
+ if (FailingCommand && FailingCommand->getCreator().isLinkJob())
return;
Diag(clang::diag::note_drv_command_failed_diag_msg)
Modified: cfe/trunk/tools/driver/driver.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/tools/driver/driver.cpp?rev=155205&r1=155204&r2=155205&view=diff
==============================================================================
--- cfe/trunk/tools/driver/driver.cpp (original)
+++ cfe/trunk/tools/driver/driver.cpp Fri Apr 20 12:08:59 2012
@@ -475,6 +475,10 @@
if (C.get())
Res = TheDriver.ExecuteCompilation(*C, FailingCommand);
+ // Force a crash to test the diagnostics.
+ if(::getenv("FORCE_CLANG_DIAGNOSTICS_CRASH"))
+ Res = -1;
+
// If result status is < 0, then the driver command signalled an error.
// In this case, generate additional diagnostic information if possible.
if (Res < 0)
More information about the cfe-commits
mailing list