aboutsummaryrefslogtreecommitdiff
path: root/llvm/utils/TableGen/DecoderEmitter.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/utils/TableGen/DecoderEmitter.cpp')
-rw-r--r--llvm/utils/TableGen/DecoderEmitter.cpp43
1 files changed, 19 insertions, 24 deletions
diff --git a/llvm/utils/TableGen/DecoderEmitter.cpp b/llvm/utils/TableGen/DecoderEmitter.cpp
index daa3062..7803509 100644
--- a/llvm/utils/TableGen/DecoderEmitter.cpp
+++ b/llvm/utils/TableGen/DecoderEmitter.cpp
@@ -1771,32 +1771,9 @@ void FilterChooser::doFilter() {
filterProcessor(BitAttrs, /*AllowMixed=*/true, /*Greedy=*/false))
return;
- // If we come to here, the instruction decoding has failed.
- assert(!BestFilter);
-}
-
-// emitTableEntries - Emit state machine entries to decode our share of
-// instructions.
-void FilterChooser::emitTableEntries(DecoderTableInfo &TableInfo) const {
- if (Opcodes.size() == 1) {
- // There is only one instruction in the set, which is great!
- // Call emitSingletonDecoder() to see whether there are any remaining
- // encodings bits.
- emitSingletonTableEntry(TableInfo, Opcodes[0]);
- return;
- }
-
- // Choose the best filter to do the decodings!
- if (BestFilter) {
- if (BestFilter->getNumFiltered() == 1)
- emitSingletonTableEntry(TableInfo, *BestFilter);
- else
- BestFilter->emitTableEntry(TableInfo);
- return;
- }
-
// We don't know how to decode these instructions! Dump the
// conflict set and bail.
+ assert(!BestFilter);
// Print out useful conflict information for postmortem analysis.
errs() << "Decoding Conflict:\n";
@@ -1812,6 +1789,24 @@ void FilterChooser::emitTableEntries(DecoderTableInfo &TableInfo) const {
PrintFatalError("Decoding conflict encountered");
}
+// emitTableEntries - Emit state machine entries to decode our share of
+// instructions.
+void FilterChooser::emitTableEntries(DecoderTableInfo &TableInfo) const {
+ if (Opcodes.size() == 1) {
+ // There is only one instruction in the set, which is great!
+ // Call emitSingletonDecoder() to see whether there are any remaining
+ // encodings bits.
+ emitSingletonTableEntry(TableInfo, Opcodes[0]);
+ return;
+ }
+
+ // Use the best filter to do the decoding!
+ if (BestFilter->getNumFiltered() == 1)
+ emitSingletonTableEntry(TableInfo, *BestFilter);
+ else
+ BestFilter->emitTableEntry(TableInfo);
+}
+
static std::string findOperandDecoderMethod(const Record *Record) {
std::string Decoder;