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
 


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
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to