mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-06 11:06:50 +00:00
fix a layering violation: VirtRegRewriter.cpp shouldn't use AsmPrinter.h.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@95748 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
1e5cc222e8
commit
45282aedb9
@ -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.
|
||||
///
|
||||
|
@ -41,6 +41,14 @@ class MachineInstr : public ilist_node<MachineInstr> {
|
||||
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.
|
||||
|
@ -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";
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user