1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 03:33:20 +01:00

Sparc: Implement emitFrameIndexDebugValue and getDebugValue Location hooks.

llvm-svn: 147269
This commit is contained in:
Venkatraman Govindaraju 2011-12-25 18:50:24 +00:00
parent 82ca4569b9
commit d9c90c9fa5
3 changed files with 28 additions and 1 deletions

View File

@ -62,6 +62,8 @@ namespace {
virtual bool isBlockOnlyReachableByFallthrough(const MachineBasicBlock *MBB)
const;
virtual MachineLocation getDebugValueLocation(const MachineInstr *MI) const;
};
} // end of anonymous namespace
@ -241,7 +243,14 @@ isBlockOnlyReachableByFallthrough(const MachineBasicBlock *MBB) const {
return I == Pred->end() || !I->isBarrier();
}
MachineLocation SparcAsmPrinter::
getDebugValueLocation(const MachineInstr *MI) const {
assert(MI->getNumOperands() == 4 && "Invalid number of operands!");
assert(MI->getOperand(0).isReg() && MI->getOperand(1).isImm() &&
"Unexpected MachineOperand types");
return MachineLocation(MI->getOperand(0).getReg(),
MI->getOperand(1).getImm());
}
// Force static initialization.
extern "C" void LLVMInitializeSparcAsmPrinter() {

View File

@ -112,6 +112,17 @@ static SPCC::CondCodes GetOppositeBranchCondition(SPCC::CondCodes CC)
}
}
MachineInstr *
SparcInstrInfo::emitFrameIndexDebugValue(MachineFunction &MF,
int FrameIx,
uint64_t Offset,
const MDNode *MDPtr,
DebugLoc dl) const {
MachineInstrBuilder MIB = BuildMI(MF, dl, get(SP::DBG_VALUE))
.addFrameIndex(FrameIx).addImm(0).addImm(Offset).addMetadata(MDPtr);
return &*MIB;
}
bool SparcInstrInfo::AnalyzeBranch(MachineBasicBlock &MBB,
MachineBasicBlock *&TBB,

View File

@ -62,6 +62,13 @@ public:
virtual unsigned isStoreToStackSlot(const MachineInstr *MI,
int &FrameIndex) const;
/// emitFrameIndexDebugValue - Emit a target-dependent form of
/// DBG_VALUE encoding the address of a frame index.
virtual MachineInstr *emitFrameIndexDebugValue(MachineFunction &MF,
int FrameIx,
uint64_t Offset,
const MDNode *MDPtr,
DebugLoc dl) const;
virtual bool AnalyzeBranch(MachineBasicBlock &MBB, MachineBasicBlock *&TBB,
MachineBasicBlock *&FBB,