summaryrefslogtreecommitdiffstats
path: root/llvm/utils/TableGen/AsmWriterEmitter.cpp
diff options
context:
space:
mode:
authorDavid Greene <greened@obbligato.org>2009-08-05 21:00:52 +0000
committerDavid Greene <greened@obbligato.org>2009-08-05 21:00:52 +0000
commitfdd2519eb5cb5615d25bd61817020f75845d7f77 (patch)
tree3bdcb64d20b639bd9126e2428862c98552e3ebca /llvm/utils/TableGen/AsmWriterEmitter.cpp
parent39fb546b9e2296abf69d5a61007b7bbf656a3270 (diff)
downloadbcm5719-llvm-fdd2519eb5cb5615d25bd61817020f75845d7f77.tar.gz
bcm5719-llvm-fdd2519eb5cb5615d25bd61817020f75845d7f77.zip
Fix some column padding bugs, reorganize things as suggested by Chris
and eliminate complexity. Yay! llvm-svn: 78243
Diffstat (limited to 'llvm/utils/TableGen/AsmWriterEmitter.cpp')
-rw-r--r--llvm/utils/TableGen/AsmWriterEmitter.cpp30
1 files changed, 4 insertions, 26 deletions
diff --git a/llvm/utils/TableGen/AsmWriterEmitter.cpp b/llvm/utils/TableGen/AsmWriterEmitter.cpp
index 5f1d3257681..de4ec226fc1 100644
--- a/llvm/utils/TableGen/AsmWriterEmitter.cpp
+++ b/llvm/utils/TableGen/AsmWriterEmitter.cpp
@@ -148,8 +148,6 @@ AsmWriterInst::AsmWriterInst(const CodeGenInstruction &CGI, unsigned Variant) {
// Emit a constant string fragment.
- // TODO: Recognize an operand separator to determine when to pad
- // to the next operator.
if (DollarPos != LastEmitted) {
if (CurVariant == Variant || CurVariant == ~0U) {
for (; LastEmitted != DollarPos; ++LastEmitted)
@@ -727,30 +725,10 @@ void AsmWriterEmitter::run(raw_ostream &O) {
O << " // Emit the opcode for the instruction.\n"
<< " unsigned Bits = OpInfo[MI->getOpcode()];\n"
- << " if (Bits == 0) return false;\n\n";
-
- O << " unsigned OperandColumn = 1;\n\n"
- << " if (TAI->getOperandColumn(1) > 0) {\n"
- << " // Don't emit trailing whitespace, let the column padding do it. This\n"
- << " // guarantees that a stray long opcode + tab won't upset the alignment.\n"
- << " // We need to handle this special case here because sometimes the initial\n"
- << " // mnemonic string includes a tab or space and sometimes it doesn't.\n"
- << " unsigned OpLength = std::strlen(AsmStrs+(Bits & " << (1 << AsmStrBits)-1 << "));\n"
- << " if (OpLength > 0 &&\n"
- << " ((AsmStrs+(Bits & " << (1 << AsmStrBits)-1 << "))[OpLength-1] == ' ' ||\n"
- << " (AsmStrs+(Bits & " << (1 << AsmStrBits)-1 << "))[OpLength-1] == '\\t')) {\n"
- << " do {\n"
- << " --OpLength;\n"
- << " } while ((AsmStrs+(Bits & " << (1 << AsmStrBits)-1 << "))[OpLength-1] == ' ' ||\n"
- << " (AsmStrs+(Bits & " << (1 << AsmStrBits)-1 << "))[OpLength-1] == '\\t');\n"
- << " for (unsigned Idx = 0; Idx < OpLength; ++Idx)\n"
- << " O << (AsmStrs+(Bits & " << (1 << AsmStrBits)-1 << "))[Idx];\n"
- << " O.PadToColumn(TAI->getOperandColumn(OperandColumn++), 1);\n"
- << " }\n"
- << " } else {\n"
- << " O << AsmStrs+(Bits & " << (1 << AsmStrBits)-1 << ");\n"
- << " }\n\n";
-
+ << " if (Bits == 0) return false;\n"
+ << " O << AsmStrs+(Bits & " << (1 << AsmStrBits)-1 << ");\n\n";
+
+ O << " unsigned OperandColumn = 1;\n\n";
// Output the table driven operand information.
BitsLeft = 32-AsmStrBits;
OpenPOWER on IntegriCloud