diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h index c85e6678cf9..3c4dcb557d8 100644 --- a/include/llvm/CodeGen/AsmPrinter.h +++ b/include/llvm/CodeGen/AsmPrinter.h @@ -80,13 +80,6 @@ namespace llvm { DwarfWriter *DW; public: - /// Flags to specify different kinds of comments to output in - /// assembly code. These flags carry semantic information not - /// otherwise easily derivable from the IR text. - /// - enum CommentFlag { - ReloadReuse = 0x1 - }; /// Output stream on which we're printing assembly code. /// diff --git a/include/llvm/CodeGen/MachineInstr.h b/include/llvm/CodeGen/MachineInstr.h index 51abcc21696..1b2de76006f 100644 --- a/include/llvm/CodeGen/MachineInstr.h +++ b/include/llvm/CodeGen/MachineInstr.h @@ -41,6 +41,14 @@ class MachineInstr : public ilist_node { public: typedef MachineMemOperand **mmo_iterator; + /// Flags to specify different kinds of comments to output in + /// assembly code. These flags carry semantic information not + /// otherwise easily derivable from the IR text. + /// + enum CommentFlag { + ReloadReuse = 0x1 + }; + private: const TargetInstrDesc *TID; // Instruction descriptor. unsigned short NumImplicitOps; // Number of implicit operands (which @@ -121,14 +129,14 @@ public: /// getAsmPrinterFlag - Return whether an AsmPrinter flag is set. /// - bool getAsmPrinterFlag(unsigned Flag) const { + bool getAsmPrinterFlag(CommentFlag Flag) const { return AsmPrinterFlags & Flag; } /// setAsmPrinterFlag - Set a flag for the AsmPrinter. /// - void setAsmPrinterFlag(unsigned short Flag) { - AsmPrinterFlags |= Flag; + void setAsmPrinterFlag(CommentFlag Flag) { + AsmPrinterFlags |= (unsigned short)Flag; } /// getDebugLoc - Returns the debug location id of this MachineInstr. diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index fe968572476..9042147afb4 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -375,7 +375,7 @@ static void EmitComments(const MachineInstr &MI, raw_ostream &CommentOS) { unsigned SrcReg, DstReg, SrcSubIdx, DstSubIdx; if (TM.getInstrInfo()->isMoveInstr(MI, SrcReg, DstReg, SrcSubIdx, DstSubIdx)) { - if (MI.getAsmPrinterFlag(AsmPrinter::ReloadReuse)) + if (MI.getAsmPrinterFlag(MachineInstr::ReloadReuse)) CommentOS << " Reload Reuse\n"; } } diff --git a/lib/CodeGen/VirtRegRewriter.cpp b/lib/CodeGen/VirtRegRewriter.cpp index dd071497672..ce625948424 100644 --- a/lib/CodeGen/VirtRegRewriter.cpp +++ b/lib/CodeGen/VirtRegRewriter.cpp @@ -10,7 +10,6 @@ #define DEBUG_TYPE "virtregrewriter" #include "VirtRegRewriter.h" #include "llvm/Function.h" -#include "llvm/CodeGen/AsmPrinter.h" // FIXME: Layering! #include "llvm/CodeGen/MachineFrameInfo.h" #include "llvm/CodeGen/MachineInstrBuilder.h" #include "llvm/CodeGen/MachineRegisterInfo.h" @@ -1760,7 +1759,7 @@ private: // Mark is killed. MachineInstr *CopyMI = prior(InsertLoc); - CopyMI->setAsmPrinterFlag(AsmPrinter::ReloadReuse); + CopyMI->setAsmPrinterFlag(MachineInstr::ReloadReuse); MachineOperand *KillOpnd = CopyMI->findRegisterUseOperand(InReg); KillOpnd->setIsKill(); UpdateKills(*CopyMI, TRI, RegKills, KillOps); @@ -2038,7 +2037,7 @@ private: TII->copyRegToReg(MBB, InsertLoc, DesignatedReg, PhysReg, RC, RC); MachineInstr *CopyMI = prior(InsertLoc); - CopyMI->setAsmPrinterFlag(AsmPrinter::ReloadReuse); + CopyMI->setAsmPrinterFlag(MachineInstr::ReloadReuse); UpdateKills(*CopyMI, TRI, RegKills, KillOps); // This invalidates DesignatedReg. @@ -2167,7 +2166,7 @@ private: // virtual or needing to clobber any values if it's physical). NextMII = &MI; --NextMII; // backtrack to the copy. - NextMII->setAsmPrinterFlag(AsmPrinter::ReloadReuse); + NextMII->setAsmPrinterFlag(MachineInstr::ReloadReuse); // Propagate the sub-register index over. if (SubIdx) { DefMO = NextMII->findRegisterDefOperand(DestReg);