summaryrefslogtreecommitdiff
path: root/utils/TableGen/AsmWriterEmitter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-01-27 02:10:50 +0000
committerChris Lattner <sabre@nondot.org>2006-01-27 02:10:50 +0000
commit0cfcc1e8072af7f3d92bbcdba48da551cccd90be (patch)
treed418eb0e3f5d1b3a3796a15bd28d129007d3b61e /utils/TableGen/AsmWriterEmitter.cpp
parent0264d1a4777370009176157b76d116b3195e3767 (diff)
downloadllvm-0cfcc1e8072af7f3d92bbcdba48da551cccd90be.tar.gz
llvm-0cfcc1e8072af7f3d92bbcdba48da551cccd90be.tar.bz2
llvm-0cfcc1e8072af7f3d92bbcdba48da551cccd90be.tar.xz
Use printInlineAsm to, well, print inline asm's.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25677 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'utils/TableGen/AsmWriterEmitter.cpp')
-rw-r--r--utils/TableGen/AsmWriterEmitter.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/utils/TableGen/AsmWriterEmitter.cpp b/utils/TableGen/AsmWriterEmitter.cpp
index cc59aa105a..e6ad2bcf81 100644
--- a/utils/TableGen/AsmWriterEmitter.cpp
+++ b/utils/TableGen/AsmWriterEmitter.cpp
@@ -345,6 +345,9 @@ void AsmWriterEmitter::run(std::ostream &O) {
break;
}
+ std::vector<const CodeGenInstruction*> NumberedInstructions;
+ Target.getInstructionsByEnumValue(NumberedInstructions);
+
if (AllStartWithString) {
// Compute the CodeGenInstruction -> AsmWriterInst mapping. Note that not
// all machine instructions are necessarily being printed, so there may be
@@ -354,9 +357,6 @@ void AsmWriterEmitter::run(std::ostream &O) {
CGIAWIMap.insert(std::make_pair(Instructions[i].CGI, &Instructions[i]));
// Emit a table of constant strings.
- std::vector<const CodeGenInstruction*> NumberedInstructions;
- Target.getInstructionsByEnumValue(NumberedInstructions);
-
O << " static const char * const OpStrs[] = {\n";
for (unsigned i = 0, e = NumberedInstructions.size(); i != e; ++i) {
AsmWriterInst *AWI = CGIAWIMap[NumberedInstructions[i]];
@@ -380,8 +380,11 @@ void AsmWriterEmitter::run(std::ostream &O) {
// elements in the vector.
std::reverse(Instructions.begin(), Instructions.end());
+ // Find the opcode # of inline asm
O << " switch (MI->getOpcode()) {\n"
- " default: return false;\n";
+ " default: return false;\n"
+ " case " << NumberedInstructions.back()->Namespace
+ << "::INLINEASM: printInlineAsm(MI); break;\n";
while (!Instructions.empty())
EmitInstructions(Instructions, O);