[llvm-commits] [llvm] r136645 - /llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp

Owen Anderson resistor at mac.com
Mon Aug 1 13:06:49 PDT 2011


Author: resistor
Date: Mon Aug  1 15:06:49 2011
New Revision: 136645

URL: http://llvm.org/viewvc/llvm-project?rev=136645&view=rev
Log:
The FixedLenDecoder needs to gracefully handle failing per-instruction decoder hooks in addition to per-operand decoder hooks.

Modified:
    llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp

Modified: llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp?rev=136645&r1=136644&r2=136645&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/FixedLenDecoderEmitter.cpp Mon Aug  1 15:06:49 2011
@@ -566,7 +566,7 @@
     "static bool decode" << Namespace << "Instruction" << BitWidth
     << "(MCInst &MI, uint" << BitWidth << "_t insn, uint64_t Address, "
     << "const void *Decoder) {\n";
-  o.indent(Indentation) << "  unsigned tmp = 0;\n(void)tmp;\n";
+  o.indent(Indentation) << "  unsigned tmp = 0;\n  (void)tmp;\n";
 
   ++Indentation; ++Indentation;
   // Emits code to decode the instructions.
@@ -776,8 +776,8 @@
          I = InsnOperands.begin(), E = InsnOperands.end(); I != E; ++I) {
       // If a custom instruction decoder was specified, use that.
       if (I->numFields() == 0 && I->Decoder.size()) {
-        o.indent(Indentation) << "  " << I->Decoder
-                              << "(MI, insn, Address, Decoder);\n";
+        o.indent(Indentation) << "  if (!" << I->Decoder
+                              << "(MI, insn, Address, Decoder)) return false;\n";
         break;
       }
 





More information about the llvm-commits mailing list