summaryrefslogtreecommitdiff
path: root/utils
diff options
context:
space:
mode:
authorOwen Anderson <resistor@mac.com>2011-08-01 20:06:49 +0000
committerOwen Anderson <resistor@mac.com>2011-08-01 20:06:49 +0000
commit5f801ba6ef5da47987ae4ccf2cc0b54cd888fc84 (patch)
treef8ef1c342de3469d2271ae8ee74f29cac3d76489 /utils
parent81fd0ba8ab153b8344527a461545dbd87642ed83 (diff)
downloadllvm-5f801ba6ef5da47987ae4ccf2cc0b54cd888fc84.tar.gz
llvm-5f801ba6ef5da47987ae4ccf2cc0b54cd888fc84.tar.bz2
llvm-5f801ba6ef5da47987ae4ccf2cc0b54cd888fc84.tar.xz
The FixedLenDecoder needs to gracefully handle failing per-instruction decoder hooks in addition to per-operand decoder hooks.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@136645 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils')
-rw-r--r--utils/TableGen/FixedLenDecoderEmitter.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/utils/TableGen/FixedLenDecoderEmitter.cpp b/utils/TableGen/FixedLenDecoderEmitter.cpp
index 5d42e71e5e..249da8e25f 100644
--- a/utils/TableGen/FixedLenDecoderEmitter.cpp
+++ b/utils/TableGen/FixedLenDecoderEmitter.cpp
@@ -566,7 +566,7 @@ void FilterChooser::emitTop(raw_ostream &o, unsigned Indentation,
"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 @@ bool FilterChooser::emitSingletonDecoder(raw_ostream &o, unsigned &Indentation,
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;
}