[llvm-commits] [llvm] r131031 - in /llvm/trunk: include/llvm/MC/MCDwarf.h lib/MC/MCDwarf.cpp
Rafael Espindola
rafael.espindola at gmail.com
Fri May 6 15:29:04 PDT 2011
Author: rafael
Date: Fri May 6 17:29:04 2011
New Revision: 131031
URL: http://llvm.org/viewvc/llvm-project?rev=131031&view=rev
Log:
Switch Darwin to the generic CIE/FDE printer.
Modified:
llvm/trunk/include/llvm/MC/MCDwarf.h
llvm/trunk/lib/MC/MCDwarf.cpp
Modified: llvm/trunk/include/llvm/MC/MCDwarf.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/MC/MCDwarf.h?rev=131031&r1=131030&r2=131031&view=diff
==============================================================================
--- llvm/trunk/include/llvm/MC/MCDwarf.h (original)
+++ llvm/trunk/include/llvm/MC/MCDwarf.h Fri May 6 17:29:04 2011
@@ -282,7 +282,6 @@
// This emits the frame info section.
//
static void Emit(MCStreamer &streamer, bool usingCFI);
- static void EmitDarwin(MCStreamer &streamer, bool usingCFI);
static void EmitAdvanceLoc(MCStreamer &Streamer, uint64_t AddrDelta);
static void EncodeAdvanceLoc(uint64_t AddrDelta, raw_ostream &OS,
const TargetAsmInfo &AsmInfo);
Modified: llvm/trunk/lib/MC/MCDwarf.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCDwarf.cpp?rev=131031&r1=131030&r2=131031&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCDwarf.cpp (original)
+++ llvm/trunk/lib/MC/MCDwarf.cpp Fri May 6 17:29:04 2011
@@ -835,74 +835,10 @@
};
}
-// This is an implementation of CIE and FDE emission that is bug by bug
-// compatible with the one in CodeGen. It is useful during the transition
-// to make it easy to compare the outputs, but should probably be removed
-// afterwards.
-void MCDwarfFrameEmitter::EmitDarwin(MCStreamer &streamer,
- bool usingCFI) {
- FrameEmitterImpl Emitter(usingCFI);
- DenseMap<const MCSymbol*, const MCSymbol*> Personalities;
- const MCSymbol *aCIE = NULL;
- const MCDwarfFrameInfo *aFrame = NULL;
-
- for (unsigned i = 0, n = streamer.getNumFrameInfos(); i < n; ++i) {
- const MCDwarfFrameInfo &frame = streamer.getFrameInfo(i);
- if (!frame.Personality)
- continue;
- if (Personalities.count(frame.Personality))
- continue;
-
- const MCSymbol *cieStart = &Emitter.EmitCIE(streamer, frame.Personality,
- frame.PersonalityEncoding,
- frame.Lsda,
- frame.LsdaEncoding);
- aCIE = cieStart;
- aFrame = &frame;
- Personalities[frame.Personality] = cieStart;
- }
-
- if (Personalities.empty()) {
- const MCDwarfFrameInfo &frame = streamer.getFrameInfo(0);
- aCIE = &Emitter.EmitCIE(streamer, frame.Personality,
- frame.PersonalityEncoding, frame.Lsda,
- frame.LsdaEncoding);
- aFrame = &frame;
- }
-
- MCSymbol *fdeEnd = NULL;
- for (unsigned i = 0, n = streamer.getNumFrameInfos(); i < n; ++i) {
- const MCDwarfFrameInfo &frame = streamer.getFrameInfo(i);
- const MCSymbol *cieStart = Personalities[frame.Personality];
- bool hasLSDA;
- if (!cieStart) {
- cieStart = aCIE;
- hasLSDA = aFrame->Lsda;
- } else {
- hasLSDA = true;
- }
-
- fdeEnd = Emitter.EmitFDE(streamer, *cieStart, frame,
- hasLSDA);
- if (i != n - 1)
- streamer.EmitLabel(fdeEnd);
- }
-
- const MCContext &context = streamer.getContext();
- const TargetAsmInfo &asmInfo = context.getTargetAsmInfo();
- streamer.EmitValueToAlignment(asmInfo.getPointerSize());
- if (fdeEnd)
- streamer.EmitLabel(fdeEnd);
-}
-
void MCDwarfFrameEmitter::Emit(MCStreamer &streamer,
bool usingCFI) {
const MCContext &context = streamer.getContext();
const TargetAsmInfo &asmInfo = context.getTargetAsmInfo();
- if (!asmInfo.isFunctionEHFrameSymbolPrivate()) {
- EmitDarwin(streamer, usingCFI);
- return;
- }
MCSymbol *fdeEnd = NULL;
DenseMap<CIEKey, const MCSymbol*> CIEStarts;
More information about the llvm-commits
mailing list