std::vector<MachineMove> Moves;
RI->getInitialFrameState(Moves);
- EmitFrameMoves(NULL, 0, Moves, false);
+ EmitFrameMoves(0, Moves, false);
Asm->EmitAlignment(2, 0, 0, false);
Asm->OutStreamer.EmitLabel(getTempLabel("debug_frame_common_end"));
Asm->OutStreamer.AddComment("FDE address range");
EmitDifference(getDWLabel("func_end", DebugFrameInfo.Number), FuncBeginSym);
- // FuncBeginSym.
- EmitFrameMoves("func_begin", DebugFrameInfo.Number, DebugFrameInfo.Moves,
- false);
+ EmitFrameMoves(FuncBeginSym, DebugFrameInfo.Moves, false);
Asm->EmitAlignment(2, 0, 0, false);
Asm->OutStreamer.EmitLabel(DebugFrameEnd);
// Indicate locations of general callee saved registers in frame.
std::vector<MachineMove> Moves;
RI->getInitialFrameState(Moves);
- EmitFrameMoves(NULL, 0, Moves, true);
+ EmitFrameMoves(0, Moves, true);
// On Darwin the linker honors the alignment of eh_frame, which means it must
// be 8-byte on 64-bit targets to match what gcc does. Otherwise you get
}
// Indicate locations of function specific callee saved registers in frame.
- // EHFuncBeginSym
- EmitFrameMoves("eh_func_begin", EHFrameInfo.Number, EHFrameInfo.Moves,
- true);
+ EmitFrameMoves(EHFuncBeginSym, EHFrameInfo.Moves, true);
// On Darwin the linker honors the alignment of eh_frame, which means it
// must be 8-byte on 64-bit targets to match what gcc does. Otherwise you
/// EmitFrameMoves - Emit frame instructions to describe the layout of the
/// frame.
-void DwarfPrinter::EmitFrameMoves(const char *BaseLabel, unsigned BaseLabelID,
+void DwarfPrinter::EmitFrameMoves(MCSymbol *BaseLabel,
const std::vector<MachineMove> &Moves,
bool isEH) {
int stackGrowth = TD->getPointerSize();
TargetFrameInfo::StackGrowsUp)
stackGrowth *= -1;
- bool IsLocal = false;
for (unsigned i = 0, N = Moves.size(); i < N; ++i) {
const MachineMove &Move = Moves[i];
unsigned LabelID = Move.getLabelID();
const MachineLocation &Src = Move.getSource();
// Advance row if new location.
- if (BaseLabel && LabelID && (BaseLabelID != LabelID || !IsLocal)) {
- EmitCFAByte(dwarf::DW_CFA_advance_loc4);
- EmitDifference(getDWLabel("label", LabelID),
- getDWLabel(BaseLabel, BaseLabelID), true);
- BaseLabelID = LabelID;
- BaseLabel = "label";
- IsLocal = true;
+ if (BaseLabel && LabelID) {
+ MCSymbol *ThisSym = getDWLabel("label", LabelID);
+ if (ThisSym != BaseLabel) {
+ EmitCFAByte(dwarf::DW_CFA_advance_loc4);
+ EmitDifference(ThisSym, BaseLabel, true);
+ BaseLabel = ThisSym;
+ }
}
// If advancing cfa.
/// EmitFrameMoves - Emit frame instructions to describe the layout of the
/// frame.
- void EmitFrameMoves(const char *BaseLabel, unsigned BaseLabelID,
+ void EmitFrameMoves(MCSymbol *BaseLabel,
const std::vector<MachineMove> &Moves, bool isEH);
};