diff options
author | Evan Cheng <evan.cheng@apple.com> | 2009-07-20 06:10:07 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2009-07-20 06:10:07 +0000 |
commit | ba8dc03935fadb05d4d68f9913543df22487f523 (patch) | |
tree | da68e2b2a533d5da5376aa397dd7a1e956a861c5 /utils/TableGen | |
parent | 1d5c49327b81fe99295dc55d3be80a229f214da3 (diff) | |
download | external_llvm-ba8dc03935fadb05d4d68f9913543df22487f523.zip external_llvm-ba8dc03935fadb05d4d68f9913543df22487f523.tar.gz external_llvm-ba8dc03935fadb05d4d68f9913543df22487f523.tar.bz2 |
Restore AsmWriterEmitter.cpp back to 74742. The recent changes broke Thumb.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76398 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen')
-rw-r--r-- | utils/TableGen/AsmWriterEmitter.cpp | 23 |
1 files changed, 7 insertions, 16 deletions
diff --git a/utils/TableGen/AsmWriterEmitter.cpp b/utils/TableGen/AsmWriterEmitter.cpp index d1cb702..f34feef 100644 --- a/utils/TableGen/AsmWriterEmitter.cpp +++ b/utils/TableGen/AsmWriterEmitter.cpp @@ -259,6 +259,8 @@ AsmWriterInst::AsmWriterInst(const CodeGenInstruction &CGI, unsigned Variant) { LastEmitted = VarEnd; } } + + AddLiteralString("\\n"); } /// MatchesAllButOneOp - If this instruction is exactly identical to the @@ -355,6 +357,7 @@ static void EmitInstructions(std::vector<AsmWriterInst> &Insts, } O << "\n"; } + O << " break;\n"; } @@ -382,12 +385,8 @@ FindUniqueOperandCommands(std::vector<std::string> &UniqueOperandCommands, Command = " " + Inst->Operands[0].getCode() + "\n"; // If this is the last operand, emit a return. - if (Inst->Operands.size() == 1) { - Command += " EmitComments(*MI);\n"; - // Print the final newline - Command += " O << \"\\n\";\n"; + if (Inst->Operands.size() == 1) Command += " return true;\n"; - } // Check to see if we already have 'Command' in UniqueOperandCommands. // If not, add it. @@ -453,12 +452,8 @@ FindUniqueOperandCommands(std::vector<std::string> &UniqueOperandCommands, std::string Command = " " + FirstInst->Operands[Op].getCode() + "\n"; // If this is the last operand, emit a return after the code. - if (FirstInst->Operands.size() == Op+1) { - Command += " EmitComments(*MI);\n"; - // Print the final newline - Command += " O << \"\\n\";\n"; + if (FirstInst->Operands.size() == Op+1) Command += " return true;\n"; - } UniqueOperandCommands[CommandIdx] += Command; InstOpsUsed[CommandIdx]++; @@ -569,11 +564,10 @@ void AsmWriterEmitter::run(raw_ostream &O) { // For the first operand check, add a default value for instructions with // just opcode strings to use. if (isFirst) { - // Do the post instruction processing and print the final newline - UniqueOperandCommands.push_back(" EmitComments(*MI);\n O << \"\\n\";\n return true;\n"); + UniqueOperandCommands.push_back(" return true;\n"); isFirst = false; } - + std::vector<unsigned> InstIdxs; std::vector<unsigned> NumInstOpsHandled; FindUniqueOperandCommands(UniqueOperandCommands, InstIdxs, @@ -745,9 +739,6 @@ void AsmWriterEmitter::run(raw_ostream &O) { EmitInstructions(Instructions, O); O << " }\n"; - O << " EmitComments(*MI);\n"; - // Print the final newline - O << " O << \"\\n\";\n"; O << " return true;\n"; } |