[PATCH] D80541: Terminate early for DS_Error

Yi Kong via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 26 02:39:36 PDT 2020


kongyi created this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.

Otherwise clang will continue running after printing the diagnostic, causing failures later in other modes, or maybe even finish successfully.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80541

Files:
  clang/lib/CodeGen/CodeGenAction.cpp


Index: clang/lib/CodeGen/CodeGenAction.cpp
===================================================================
--- clang/lib/CodeGen/CodeGenAction.cpp
+++ clang/lib/CodeGen/CodeGenAction.cpp
@@ -899,6 +899,9 @@
   // Report the backend message using the usual diagnostic mechanism.
   FullSourceLoc Loc;
   Diags.Report(Loc, DiagID).AddString(MsgStorage);
+
+  if (Severity == DS_Error)
+    exit(1);
 }
 #undef ComputeDiagID
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80541.266131.patch
Type: text/x-patch
Size: 428 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20200526/0d615fda/attachment.bin>


More information about the cfe-commits mailing list