From e0c74fb1defc85dfcf86cbf17fd86c0f0ed2b578 Mon Sep 17 00:00:00 2001 From: Johnny Chen Date: Fri, 9 Apr 2010 19:31:33 +0000 Subject: [PATCH] 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 --- utils/TableGen/ARMDecoderEmitter.cpp | 36 +++++++++++++++------------- 1 file changed, 19 insertions(+), 17 deletions(-) diff --git a/utils/TableGen/ARMDecoderEmitter.cpp b/utils/TableGen/ARMDecoderEmitter.cpp index 55ea25b2104..22e33b74503 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; } -- 2.34.1