mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-07-24 22:24:54 +00:00
Relax address updates in the eh_frame section.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@122591 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -52,6 +52,7 @@ public:
|
||||
FT_Inst,
|
||||
FT_Org,
|
||||
FT_Dwarf,
|
||||
FT_DwarfFrame,
|
||||
FT_LEB
|
||||
};
|
||||
|
||||
@@ -369,7 +370,7 @@ class MCDwarfLineAddrFragment : public MCFragment {
|
||||
|
||||
public:
|
||||
MCDwarfLineAddrFragment(int64_t _LineDelta, const MCExpr &_AddrDelta,
|
||||
MCSectionData *SD = 0)
|
||||
MCSectionData *SD)
|
||||
: MCFragment(FT_Dwarf, SD),
|
||||
LineDelta(_LineDelta), AddrDelta(&_AddrDelta) { Contents.push_back(0); }
|
||||
|
||||
@@ -391,6 +392,34 @@ public:
|
||||
static bool classof(const MCDwarfLineAddrFragment *) { return true; }
|
||||
};
|
||||
|
||||
class MCDwarfCallFrameFragment : public MCFragment {
|
||||
/// AddrDelta - The expression for the difference of the two symbols that
|
||||
/// make up the address delta between two .cfi_* dwarf directives.
|
||||
const MCExpr *AddrDelta;
|
||||
|
||||
SmallString<8> Contents;
|
||||
|
||||
public:
|
||||
MCDwarfCallFrameFragment(const MCExpr &_AddrDelta, MCSectionData *SD)
|
||||
: MCFragment(FT_DwarfFrame, SD),
|
||||
AddrDelta(&_AddrDelta) { Contents.push_back(0); }
|
||||
|
||||
/// @name Accessors
|
||||
/// @{
|
||||
|
||||
const MCExpr &getAddrDelta() const { return *AddrDelta; }
|
||||
|
||||
SmallString<8> &getContents() { return Contents; }
|
||||
const SmallString<8> &getContents() const { return Contents; }
|
||||
|
||||
/// @}
|
||||
|
||||
static bool classof(const MCFragment *F) {
|
||||
return F->getKind() == MCFragment::FT_DwarfFrame;
|
||||
}
|
||||
static bool classof(const MCDwarfCallFrameFragment *) { return true; }
|
||||
};
|
||||
|
||||
// FIXME: Should this be a separate class, or just merged into MCSection? Since
|
||||
// we anticipate the fast path being through an MCAssembler, the only reason to
|
||||
// keep it out is for API abstraction.
|
||||
@@ -705,6 +734,8 @@ private:
|
||||
bool RelaxLEB(MCAsmLayout &Layout, MCLEBFragment &IF);
|
||||
|
||||
bool RelaxDwarfLineAddr(MCAsmLayout &Layout, MCDwarfLineAddrFragment &DF);
|
||||
bool RelaxDwarfCallFrameFragment(MCAsmLayout &Layout,
|
||||
MCDwarfCallFrameFragment &DF);
|
||||
|
||||
/// FinishLayout - Finalize a layout, including fragment lowering.
|
||||
void FinishLayout(MCAsmLayout &Layout);
|
||||
|
@@ -25,6 +25,7 @@
|
||||
namespace llvm {
|
||||
class MachineMove;
|
||||
class MCContext;
|
||||
class MCExpr;
|
||||
class MCSection;
|
||||
class MCSectionData;
|
||||
class MCStreamer;
|
||||
@@ -245,6 +246,8 @@ namespace llvm {
|
||||
// This emits the frame info section.
|
||||
//
|
||||
static void Emit(MCStreamer &streamer);
|
||||
static void EmitAdvanceLoc(MCStreamer &Streamer, uint64_t AddrDelta);
|
||||
static void EncodeAdvanceLoc(uint64_t AddrDelta, raw_ostream &OS);
|
||||
};
|
||||
} // end namespace llvm
|
||||
|
||||
|
@@ -71,6 +71,8 @@ public:
|
||||
virtual void EmitDwarfAdvanceLineAddr(int64_t LineDelta,
|
||||
const MCSymbol *LastLabel,
|
||||
const MCSymbol *Label);
|
||||
virtual void EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
|
||||
const MCSymbol *Label);
|
||||
virtual void Finish();
|
||||
|
||||
/// @}
|
||||
|
@@ -386,6 +386,10 @@ namespace llvm {
|
||||
const MCSymbol *LastLabel,
|
||||
const MCSymbol *Label) = 0;
|
||||
|
||||
virtual void EmitDwarfAdvanceFrameAddr(const MCSymbol *LastLabel,
|
||||
const MCSymbol *Label) {
|
||||
}
|
||||
|
||||
void EmitDwarfSetLineAddr(int64_t LineDelta, const MCSymbol *Label,
|
||||
int PointerSize);
|
||||
|
||||
|
Reference in New Issue
Block a user