summaryrefslogtreecommitdiff
path: root/utils/TableGen/ARMDecoderEmitter.cpp
diff options
context:
space:
mode:
authorJohnny Chen <johnny.chen@apple.com>2010-04-09 19:31:33 +0000
committerJohnny Chen <johnny.chen@apple.com>2010-04-09 19:31:33 +0000
commite0c74fb1defc85dfcf86cbf17fd86c0f0ed2b578 (patch)
tree2edd97aeb9717d3f9c4d0da917ecea3ac87e9336 /utils/TableGen/ARMDecoderEmitter.cpp
parentf8d0578e4cbd5922696c92f5068c5513d8e8d60e (diff)
downloadllvm-e0c74fb1defc85dfcf86cbf17fd86c0f0ed2b578.tar.gz
llvm-e0c74fb1defc85dfcf86cbf17fd86c0f0ed2b578.tar.bz2
llvm-e0c74fb1defc85dfcf86cbf17fd86c0f0ed2b578.tar.xz
ARM decoder emitter should print out useful information unconditionally when it
encounters decoding conflicts, instead of wrapping it inside the DEBUG() macro. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100886 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/ARMDecoderEmitter.cpp')
-rw-r--r--utils/TableGen/ARMDecoderEmitter.cpp36
1 files changed, 19 insertions, 17 deletions
diff --git a/utils/TableGen/ARMDecoderEmitter.cpp b/utils/TableGen/ARMDecoderEmitter.cpp
index 55ea25b210..22e33b7450 100644
--- a/utils/TableGen/ARMDecoderEmitter.cpp
+++ b/utils/TableGen/ARMDecoderEmitter.cpp
@@ -1344,23 +1344,8 @@ void FilterChooser::doFilter() {
return;
// If we come to here, the instruction decoding has failed.
- // Print out the instructions in the conflict set...
+ // Set the BestIndex to -1 to indicate so.
BestIndex = -1;
-
- DEBUG({
- errs() << "Conflict:\n";
-
- dumpStack(errs(), "\t\t");
-
- for (unsigned i = 0; i < Num; i++) {
- const std::string &Name = nameWithID(Opcodes[i]);
-
- errs() << '\t' << Name << " ";
- dumpBits(errs(),
- getBitsField(*AllInstructions[Opcodes[i]]->TheDef, "Inst"));
- errs() << '\n';
- }
- });
}
// Emits code to decode our share of instructions. Returns true if the
@@ -1465,7 +1450,9 @@ bool FilterChooser::emit(raw_ostream &o, unsigned &Indentation) {
// Otherwise, it does not belong to the known conflict sets.
}
- // We don't know how to decode these instructions! Dump the conflict set!
+
+ // We don't know how to decode these instructions! Return 0 and dump the
+ // conflict set!
o.indent(Indentation) << "return 0;" << " // Conflict set: ";
for (int i = 0, N = Opcodes.size(); i < N; ++i) {
o << nameWithID(Opcodes[i]);
@@ -1474,6 +1461,21 @@ bool FilterChooser::emit(raw_ostream &o, unsigned &Indentation) {
else
o << '\n';
}
+
+ // Print out useful conflict information for postmortem analysis.
+ errs() << "Decoding Conflict:\n";
+
+ dumpStack(errs(), "\t\t");
+
+ for (unsigned i = 0; i < Opcodes.size(); i++) {
+ const std::string &Name = nameWithID(Opcodes[i]);
+
+ errs() << '\t' << Name << " ";
+ dumpBits(errs(),
+ getBitsField(*AllInstructions[Opcodes[i]]->TheDef, "Inst"));
+ errs() << '\n';
+ }
+
return true;
}