[llvm] r293999 - [LLC] Add an inline assembly diagnostics handler.
Sanne Wouda via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 3 03:14:40 PST 2017
Author: sanwou01
Date: Fri Feb 3 05:14:39 2017
New Revision: 293999
URL: http://llvm.org/viewvc/llvm-project?rev=293999&view=rev
Log:
[LLC] Add an inline assembly diagnostics handler.
Summary:
llc would hit a fatal error for errors in inline assembly. The
diagnostics message is now printed.
Reviewers: rengolin, MatzeB, javed.absar, anemet
Reviewed By: anemet
Subscribers: jyknight, nemanjai, llvm-commits
Differential Revision: https://reviews.llvm.org/D29408
Modified:
llvm/trunk/test/CodeGen/AArch64/mature-mc-support.ll
llvm/trunk/test/CodeGen/ARM/mature-mc-support.ll
llvm/trunk/test/CodeGen/Mips/mature-mc-support.ll
llvm/trunk/test/CodeGen/PowerPC/mature-mc-support.ll
llvm/trunk/test/CodeGen/SPARC/mature-mc-support.ll
llvm/trunk/test/CodeGen/SystemZ/mature-mc-support.ll
llvm/trunk/test/CodeGen/Thumb/mature-mc-support.ll
llvm/trunk/test/CodeGen/X86/mature-mc-support.ll
llvm/trunk/tools/llc/llc.cpp
Modified: llvm/trunk/test/CodeGen/AArch64/mature-mc-support.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/AArch64/mature-mc-support.ll?rev=293999&r1=293998&r2=293999&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/AArch64/mature-mc-support.ll (original)
+++ llvm/trunk/test/CodeGen/AArch64/mature-mc-support.ll Fri Feb 3 05:14:39 2017
@@ -9,4 +9,4 @@
module asm " .this_directive_is_very_unlikely_to_exist"
-; CHECK: LLVM ERROR: Error parsing inline asm
+; CHECK: error: unknown directive
Modified: llvm/trunk/test/CodeGen/ARM/mature-mc-support.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/mature-mc-support.ll?rev=293999&r1=293998&r2=293999&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/mature-mc-support.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/mature-mc-support.ll Fri Feb 3 05:14:39 2017
@@ -9,4 +9,4 @@
module asm " .this_directive_is_very_unlikely_to_exist"
-; CHECK: LLVM ERROR: Error parsing inline asm
+; CHECK: error: unknown directive
Modified: llvm/trunk/test/CodeGen/Mips/mature-mc-support.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Mips/mature-mc-support.ll?rev=293999&r1=293998&r2=293999&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Mips/mature-mc-support.ll (original)
+++ llvm/trunk/test/CodeGen/Mips/mature-mc-support.ll Fri Feb 3 05:14:39 2017
@@ -29,4 +29,4 @@
module asm " .this_directive_is_very_unlikely_to_exist"
-; CHECK: LLVM ERROR: Error parsing inline asm
+; CHECK: error: unknown directive
Modified: llvm/trunk/test/CodeGen/PowerPC/mature-mc-support.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/PowerPC/mature-mc-support.ll?rev=293999&r1=293998&r2=293999&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/PowerPC/mature-mc-support.ll (original)
+++ llvm/trunk/test/CodeGen/PowerPC/mature-mc-support.ll Fri Feb 3 05:14:39 2017
@@ -28,4 +28,4 @@
module asm " .this_directive_is_very_unlikely_to_exist"
-; CHECK: LLVM ERROR: Error parsing inline asm
+; CHECK: error: unknown directive
Modified: llvm/trunk/test/CodeGen/SPARC/mature-mc-support.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/SPARC/mature-mc-support.ll?rev=293999&r1=293998&r2=293999&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/SPARC/mature-mc-support.ll (original)
+++ llvm/trunk/test/CodeGen/SPARC/mature-mc-support.ll Fri Feb 3 05:14:39 2017
@@ -17,4 +17,4 @@
module asm " .this_directive_is_very_unlikely_to_exist"
-; CHECK: LLVM ERROR: Error parsing inline asm
+; CHECK: error: unknown directive
Modified: llvm/trunk/test/CodeGen/SystemZ/mature-mc-support.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/SystemZ/mature-mc-support.ll?rev=293999&r1=293998&r2=293999&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/SystemZ/mature-mc-support.ll (original)
+++ llvm/trunk/test/CodeGen/SystemZ/mature-mc-support.ll Fri Feb 3 05:14:39 2017
@@ -12,4 +12,4 @@
module asm " .this_directive_is_very_unlikely_to_exist"
-; CHECK: LLVM ERROR: Error parsing inline asm
+; CHECK: error: unknown directive
Modified: llvm/trunk/test/CodeGen/Thumb/mature-mc-support.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/Thumb/mature-mc-support.ll?rev=293999&r1=293998&r2=293999&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/Thumb/mature-mc-support.ll (original)
+++ llvm/trunk/test/CodeGen/Thumb/mature-mc-support.ll Fri Feb 3 05:14:39 2017
@@ -9,4 +9,4 @@
module asm " .this_directive_is_very_unlikely_to_exist"
-; CHECK: LLVM ERROR: Error parsing inline asm
+; CHECK: error: unknown directive
Modified: llvm/trunk/test/CodeGen/X86/mature-mc-support.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/X86/mature-mc-support.ll?rev=293999&r1=293998&r2=293999&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/X86/mature-mc-support.ll (original)
+++ llvm/trunk/test/CodeGen/X86/mature-mc-support.ll Fri Feb 3 05:14:39 2017
@@ -15,4 +15,4 @@
module asm " .this_directive_is_very_unlikely_to_exist"
-; CHECK: LLVM ERROR: Error parsing inline asm
+; CHECK: error: unknown directive
Modified: llvm/trunk/tools/llc/llc.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llc/llc.cpp?rev=293999&r1=293998&r2=293999&view=diff
==============================================================================
--- llvm/trunk/tools/llc/llc.cpp (original)
+++ llvm/trunk/tools/llc/llc.cpp Fri Feb 3 05:14:39 2017
@@ -253,6 +253,15 @@ static void DiagnosticHandler(const Diag
errs() << "\n";
}
+static void InlineAsmDiagHandler(const SMDiagnostic &SMD, void *Context,
+ unsigned) {
+ bool *HasError = static_cast<bool *>(Context);
+ if (SMD.getKind() == SourceMgr::DK_Error)
+ *HasError = true;
+
+ SMD.print(nullptr, errs());
+}
+
// main - Entry point for the llc compiler.
//
int main(int argc, char **argv) {
@@ -294,6 +303,8 @@ int main(int argc, char **argv) {
// Set a diagnostic handler that doesn't exit on the first error
bool HasError = false;
Context.setDiagnosticHandler(DiagnosticHandler, &HasError);
+ Context.setInlineAsmDiagnosticHandler(InlineAsmDiagHandler, &HasError);
+
if (PassRemarksWithHotness)
Context.setDiagnosticHotnessRequested(true);
More information about the llvm-commits
mailing list