summaryrefslogtreecommitdiffstats
path: root/llvm/lib/MC/MCDwarf.cpp
diff options
context:
space:
mode:
authorBill Wendling <isanbard@gmail.com>2011-07-07 00:54:13 +0000
committerBill Wendling <isanbard@gmail.com>2011-07-07 00:54:13 +0000
commitb6adf46f625cc98aaa9906420a8904d0955dac0e (patch)
treee4cb785b4717acda481959fd74c2a81419fc48f9 /llvm/lib/MC/MCDwarf.cpp
parent4c08a9f83815e7ec357469724cc55a4b8e8aad25 (diff)
downloadbcm5719-llvm-b6adf46f625cc98aaa9906420a8904d0955dac0e.tar.gz
bcm5719-llvm-b6adf46f625cc98aaa9906420a8904d0955dac0e.zip
Add a target hook to encode the compact unwind information.
llvm-svn: 134577
Diffstat (limited to 'llvm/lib/MC/MCDwarf.cpp')
-rw-r--r--llvm/lib/MC/MCDwarf.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/llvm/lib/MC/MCDwarf.cpp b/llvm/lib/MC/MCDwarf.cpp
index cbdf410f218..bc900ca6e94 100644
--- a/llvm/lib/MC/MCDwarf.cpp
+++ b/llvm/lib/MC/MCDwarf.cpp
@@ -499,7 +499,6 @@ namespace {
bool UsingCFI;
bool IsEH;
const MCSymbol *SectionStart;
-
public:
FrameEmitterImpl(bool usingCFI, bool isEH, const MCSymbol *sectionStart) :
CFAOffset(0), CIENum(0), UsingCFI(usingCFI), IsEH(isEH),
@@ -714,6 +713,11 @@ bool FrameEmitterImpl::EmitCompactUnwind(MCStreamer &Streamer,
// .quad __gxx_personality
// .quad except_tab1
+ uint32_t Encoding =
+ TAI.getCompactUnwindEncoding(Frame.Instructions,
+ getDataAlignmentFactor(Streamer), IsEH);
+ if (!Encoding) return false;
+
Streamer.SwitchSection(TAI.getCompactUnwindSection());
// Range Start
@@ -728,12 +732,10 @@ bool FrameEmitterImpl::EmitCompactUnwind(MCStreamer &Streamer,
if (VerboseAsm) Streamer.AddComment("Range Length");
Streamer.EmitAbsValue(Range, 4);
- // FIXME:
// Compact Encoding
- const std::vector<MachineMove> &Moves = TAI.getInitialFrameState();
- uint32_t Encoding = 0;
Size = getSizeForEncoding(Streamer, dwarf::DW_EH_PE_udata4);
- if (VerboseAsm) Streamer.AddComment("Compact Unwind Encoding");
+ if (VerboseAsm) Streamer.AddComment(Twine("Compact Unwind Encoding: 0x") +
+ Twine(llvm::utohexstr(Encoding)));
Streamer.EmitIntValue(Encoding, Size);
// Personality Function
@@ -774,7 +776,7 @@ const MCSymbol &FrameEmitterImpl::EmitCIE(MCStreamer &streamer,
streamer.EmitLabel(sectionStart);
CIENum++;
- MCSymbol *sectionEnd = streamer.getContext().CreateTempSymbol();
+ MCSymbol *sectionEnd = context.CreateTempSymbol();
// Length
const MCExpr *Length = MakeStartMinusEndExpr(streamer, *sectionStart,
OpenPOWER on IntegriCloud