[llvm-commits] [llvm] r130472 - /llvm/trunk/lib/MC/MCDwarf.cpp
Rafael Espindola
rafael.espindola at gmail.com
Thu Apr 28 20:06:30 PDT 2011
Author: rafael
Date: Thu Apr 28 22:06:29 2011
New Revision: 130472
URL: http://llvm.org/viewvc/llvm-project?rev=130472&view=rev
Log:
Last bit by bit compatibility patch to MCDwarf.cpp: If a FDE with no LSDA is
assigned to a CIE that requires one, just output a 0.
Modified:
llvm/trunk/lib/MC/MCDwarf.cpp
Modified: llvm/trunk/lib/MC/MCDwarf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDwarf.cpp?rev=130472&r1=130471&r2=130472&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCDwarf.cpp (original)
+++ llvm/trunk/lib/MC/MCDwarf.cpp Thu Apr 28 22:06:29 2011
@@ -517,7 +517,8 @@
unsigned lsdaEncoding);
MCSymbol *EmitFDE(MCStreamer &streamer,
const MCSymbol &cieStart,
- const MCDwarfFrameInfo &frame);
+ const MCDwarfFrameInfo &frame,
+ bool forceLsda);
void EmitCFIInstructions(MCStreamer &streamer,
const std::vector<MCCFIInstruction> &Instrs,
MCSymbol *BaseLabel);
@@ -727,7 +728,8 @@
MCSymbol *FrameEmitterImpl::EmitFDE(MCStreamer &streamer,
const MCSymbol &cieStart,
- const MCDwarfFrameInfo &frame) {
+ const MCDwarfFrameInfo &frame,
+ bool forceLsda) {
MCContext &context = streamer.getContext();
MCSymbol *fdeStart = context.CreateTempSymbol();
MCSymbol *fdeEnd = context.CreateTempSymbol();
@@ -770,8 +772,15 @@
// Augmentation Data
streamer.EmitLabel(augmentationStart);
+
+ // When running in "CodeGen compatibility mode" a FDE with no LSDA can be
+ // assigned to a CIE that requires one. In that case we output a 0 (as does
+ // CodeGen).
if (frame.Lsda)
EmitSymbol(streamer, *frame.Lsda, frame.LsdaEncoding);
+ else if (forceLsda)
+ streamer.EmitIntValue(0, size);
+
streamer.EmitLabel(augmentationEnd);
// Call Frame Instructions
@@ -862,10 +871,16 @@
for (unsigned i = 0, n = streamer.getNumFrameInfos(); i < n; ++i) {
const MCDwarfFrameInfo &frame = streamer.getFrameInfo(i);
const MCSymbol *cieStart = Personalities[frame.Personality];
- if (!cieStart)
+ bool hasLSDA;
+ if (!cieStart) {
cieStart = aCIE;
+ hasLSDA = aFrame->Lsda;
+ } else {
+ hasLSDA = true;
+ }
- fdeEnd = Emitter.EmitFDE(streamer, *cieStart, frame);
+ fdeEnd = Emitter.EmitFDE(streamer, *cieStart, frame,
+ hasLSDA);
if (i != n - 1)
streamer.EmitLabel(fdeEnd);
}
@@ -898,7 +913,7 @@
cieStart = &Emitter.EmitCIE(streamer, frame.Personality,
frame.PersonalityEncoding, frame.Lsda,
frame.LsdaEncoding);
- fdeEnd = Emitter.EmitFDE(streamer, *cieStart, frame);
+ fdeEnd = Emitter.EmitFDE(streamer, *cieStart, frame, false);
if (i != n - 1)
streamer.EmitLabel(fdeEnd);
}
More information about the llvm-commits
mailing list