Clean up asm writer usage for x86 and msp430 to flag that the writer should
authorJim Grosbach <grosbach@apple.com>
Thu, 30 Sep 2010 23:40:25 +0000 (23:40 +0000)
committerJim Grosbach <grosbach@apple.com>
Thu, 30 Sep 2010 23:40:25 +0000 (23:40 +0000)
use MC instructions in the printInstruction() method via the tablegen flag
for it rather than a #define prior to including the autogenerated bits.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@115238 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/MSP430/AsmPrinter/MSP430InstPrinter.cpp
lib/Target/MSP430/MSP430.td
lib/Target/X86/AsmPrinter/X86ATTInstPrinter.cpp
lib/Target/X86/AsmPrinter/X86IntelInstPrinter.cpp
lib/Target/X86/X86.td

index c15d4085bc8b78be07a56656674de971e5d85577..304e677d6f9ee56627806f09ee22bd93174157aa 100644 (file)
@@ -24,9 +24,7 @@ using namespace llvm;
 
 
 // Include the auto-generated portion of the assembly writer.
-#define MachineInstr MCInst
 #include "MSP430GenAsmWriter.inc"
-#undef MachineInstr
 
 void MSP430InstPrinter::printInst(const MCInst *MI, raw_ostream &O) {
   printInstruction(MI, O);
index 0f08e3d8ca0f597b5e7da34d4c7d51a695a02a74..5cc5e6e3d7c9e927a7266ea311ca04cf3f4ee682 100644 (file)
@@ -52,6 +52,7 @@ def MSP430InstrInfo : InstrInfo;
 
 def MSP430InstPrinter : AsmWriter {
   string AsmWriterClassName  = "InstPrinter";
+  bit isMCAsmWriter = 1;
 }
 
 //===----------------------------------------------------------------------===//
index 554b96c96e0e5541ac2af73908e8c7535031f0f3..d6950f49f824bcafa2624b85fa66a59775a11967 100644 (file)
 using namespace llvm;
 
 // Include the auto-generated portion of the assembly writer.
-#define MachineInstr MCInst
 #define GET_INSTRUCTION_NAME
 #include "X86GenAsmWriter.inc"
-#undef MachineInstr
 
 void X86ATTInstPrinter::printInst(const MCInst *MI, raw_ostream &OS) {
   printInstruction(MI, OS);
index 5625b0ea618f81446544f877be1d7c2c1db67bdd..a553a7c19a057aea506aebc09d6b5541fdc85245 100644 (file)
 using namespace llvm;
 
 // Include the auto-generated portion of the assembly writer.
-#define MachineInstr MCInst
 #define GET_INSTRUCTION_NAME
 #include "X86GenAsmWriter1.inc"
-#undef MachineInstr
 
 void X86IntelInstPrinter::printInst(const MCInst *MI, raw_ostream &OS) {
   printInstruction(MI, OS);
index a19f1acffaca89b88c953cecacdb83168dcb8377..b78c7d6a7d42494fff383a476f37c8e303290ad8 100644 (file)
@@ -196,10 +196,12 @@ def ATTAsmParser : AsmParser {
 def ATTAsmWriter : AsmWriter {
   string AsmWriterClassName  = "ATTInstPrinter";
   int Variant = 0;
+  bit isMCAsmWriter = 1;
 }
 def IntelAsmWriter : AsmWriter {
   string AsmWriterClassName  = "IntelInstPrinter";
   int Variant = 1;
+  bit isMCAsmWriter = 1;
 }
 
 def X86 : Target {