[PATCH] D25834: [MC] Make llvm-mc fail cleanly on invalid output asm variant.
Nirav Dave via llvm-commits
llvm-commits at lists.llvm.org
Mon Oct 31 11:46:02 PDT 2016
This revision was automatically updated to reflect the committed changes.
Closed by commit rL285616: [MC] Make llvm-mc fail cleanly on invalid output asm variant. (authored by niravd).
Changed prior to commit:
https://reviews.llvm.org/D25834?vs=76422&id=76452#toc
Repository:
rL LLVM
https://reviews.llvm.org/D25834
Files:
llvm/trunk/test/MC/AsmParser/invalid-asm-variant.s
llvm/trunk/tools/llvm-mc/llvm-mc.cpp
Index: llvm/trunk/tools/llvm-mc/llvm-mc.cpp
===================================================================
--- llvm/trunk/tools/llvm-mc/llvm-mc.cpp
+++ llvm/trunk/tools/llvm-mc/llvm-mc.cpp
@@ -563,6 +563,14 @@
IP = TheTarget->createMCInstPrinter(Triple(TripleName), OutputAsmVariant,
*MAI, *MCII, *MRI);
+ if (!IP) {
+ errs()
+ << "error: unable to create instruction printer for target triple '"
+ << TheTriple.normalize() << "' with assembly variant "
+ << OutputAsmVariant << ".\n";
+ return 1;
+ }
+
// Set the display preference for hex vs. decimal immediates.
IP->setPrintImmHex(PrintImmHex);
Index: llvm/trunk/test/MC/AsmParser/invalid-asm-variant.s
===================================================================
--- llvm/trunk/test/MC/AsmParser/invalid-asm-variant.s
+++ llvm/trunk/test/MC/AsmParser/invalid-asm-variant.s
@@ -0,0 +1,3 @@
+//RUN: not llvm-mc --disassemble -triple=x86_64 --output-asm-variant=2 %s -o - 2>&1 | FileCheck %s
+
+//CHECK: error: unable to create instruction printer for target triple 'x86_64' with assembly variant 2.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D25834.76452.patch
Type: text/x-patch
Size: 1167 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20161031/46d38f25/attachment.bin>
More information about the llvm-commits
mailing list