aboutsummaryrefslogtreecommitdiffstats
path: root/lib/MC
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2011-04-29 03:06:29 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2011-04-29 03:06:29 +0000
commit4892dff07e7d99eb37aee868c4f2c91e9c7eba14 (patch)
tree19b57ba0b8ca630e497bdb608f76e684911b06b3 /lib/MC
parent9099813bd50a05c4b2a495e3cea817f49c1372d8 (diff)
downloadexternal_llvm-4892dff07e7d99eb37aee868c4f2c91e9c7eba14.zip
external_llvm-4892dff07e7d99eb37aee868c4f2c91e9c7eba14.tar.gz
external_llvm-4892dff07e7d99eb37aee868c4f2c91e9c7eba14.tar.bz2
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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@130472 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC')
-rw-r--r--lib/MC/MCDwarf.cpp25
1 files changed, 20 insertions, 5 deletions
diff --git a/lib/MC/MCDwarf.cpp b/lib/MC/MCDwarf.cpp
index 1848430..3b81668 100644
--- a/lib/MC/MCDwarf.cpp
+++ b/lib/MC/MCDwarf.cpp
@@ -517,7 +517,8 @@ namespace {
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 @@ const MCSymbol &FrameEmitterImpl::EmitCIE(MCStreamer &streamer,
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 @@ MCSymbol *FrameEmitterImpl::EmitFDE(MCStreamer &streamer,
// 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 @@ void MCDwarfFrameEmitter::EmitDarwin(MCStreamer &streamer) {
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 @@ void MCDwarfFrameEmitter::Emit(MCStreamer &streamer) {
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);
}