More dead code elimination.

llvm-svn: 130985
This commit is contained in:
Rafael Espindola 2011-05-06 15:22:26 +00:00
parent a716096677
commit 4bfa978ca5
2 changed files with 0 additions and 73 deletions

View File

@ -398,8 +398,6 @@ namespace llvm {
/// EmitFrameMoves - Emit frame instructions to describe the layout of the
/// frame.
void EmitFrameMoves(const std::vector<MachineMove> &Moves,
MCSymbol *BaseLabel, bool isEH) const;
void EmitCFIFrameMove(const MachineMove &Move) const;
void EmitCFIFrameMoves(const std::vector<MachineMove> &Moves) const;

View File

@ -206,77 +206,6 @@ void AsmPrinter::EmitSectionOffset(const MCSymbol *Label,
// Dwarf Lowering Routines
//===----------------------------------------------------------------------===//
/// EmitFrameMoves - Emit frame instructions to describe the layout of the
/// frame.
void AsmPrinter::EmitFrameMoves(const std::vector<MachineMove> &Moves,
MCSymbol *BaseLabel, bool isEH) const {
const TargetRegisterInfo *RI = TM.getRegisterInfo();
int stackGrowth = TM.getTargetData()->getPointerSize();
if (TM.getFrameLowering()->getStackGrowthDirection() !=
TargetFrameLowering::StackGrowsUp)
stackGrowth *= -1;
for (unsigned i = 0, N = Moves.size(); i < N; ++i) {
const MachineMove &Move = Moves[i];
MCSymbol *Label = Move.getLabel();
// Throw out move if the label is invalid.
if (Label && !Label->isDefined()) continue; // Not emitted, in dead code.
const MachineLocation &Dst = Move.getDestination();
const MachineLocation &Src = Move.getSource();
// Advance row if new location.
if (BaseLabel && Label) {
MCSymbol *ThisSym = Label;
if (ThisSym != BaseLabel) {
EmitCFAByte(dwarf::DW_CFA_advance_loc4);
EmitLabelDifference(ThisSym, BaseLabel, 4);
BaseLabel = ThisSym;
}
}
// If advancing cfa.
if (Dst.isReg() && Dst.getReg() == MachineLocation::VirtualFP) {
assert(!Src.isReg() && "Machine move not supported yet.");
if (Src.getReg() == MachineLocation::VirtualFP) {
EmitCFAByte(dwarf::DW_CFA_def_cfa_offset);
} else {
EmitCFAByte(dwarf::DW_CFA_def_cfa);
EmitULEB128(RI->getDwarfRegNum(Src.getReg(), isEH), "Register");
}
EmitULEB128(-Src.getOffset(), "Offset");
continue;
}
if (Src.isReg() && Src.getReg() == MachineLocation::VirtualFP) {
assert(Dst.isReg() && "Machine move not supported yet.");
EmitCFAByte(dwarf::DW_CFA_def_cfa_register);
EmitULEB128(RI->getDwarfRegNum(Dst.getReg(), isEH), "Register");
continue;
}
unsigned Reg = RI->getDwarfRegNum(Src.getReg(), isEH);
int Offset = Dst.getOffset() / stackGrowth;
if (Offset < 0) {
EmitCFAByte(dwarf::DW_CFA_offset_extended_sf);
EmitULEB128(Reg, "Reg");
EmitSLEB128(Offset, "Offset");
} else if (Reg < 64) {
EmitCFAByte(dwarf::DW_CFA_offset + Reg);
EmitULEB128(Offset, "Offset");
} else {
EmitCFAByte(dwarf::DW_CFA_offset_extended);
EmitULEB128(Reg, "Reg");
EmitULEB128(Offset, "Offset");
}
}
}
/// EmitFrameMoves - Emit a frame instruction.
void AsmPrinter::EmitCFIFrameMove(const MachineMove &Move) const {
const TargetRegisterInfo *RI = TM.getRegisterInfo();