mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-02-08 06:32:24 +00:00
As a first step, emit both the compact unwind and CIE/FDEs for a function.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@139152 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
81856f7313
commit
d8ab8e9707
@ -1013,24 +1013,18 @@ void MCDwarfFrameEmitter::Emit(MCStreamer &Streamer,
|
|||||||
MCObjectFileInfo *MOFI =
|
MCObjectFileInfo *MOFI =
|
||||||
const_cast<MCObjectFileInfo*>(Context.getObjectFileInfo());
|
const_cast<MCObjectFileInfo*>(Context.getObjectFileInfo());
|
||||||
FrameEmitterImpl Emitter(UsingCFI, IsEH);
|
FrameEmitterImpl Emitter(UsingCFI, IsEH);
|
||||||
SmallVector<MCDwarfFrameInfo, 8> RequiresFDE;
|
ArrayRef<MCDwarfFrameInfo> FrameArray = Streamer.getFrameInfos();
|
||||||
ArrayRef<MCDwarfFrameInfo> FrameArray;
|
|
||||||
|
|
||||||
if (IsEH && MOFI->getCompactUnwindSection()) {
|
// Emit the compact unwind info if available.
|
||||||
|
// FIXME: This emits both the compact unwind and the old CIE/FDE
|
||||||
|
// information. Only one of those is needed.
|
||||||
|
if (IsEH && MOFI->getCompactUnwindSection())
|
||||||
for (unsigned i = 0, n = Streamer.getNumFrameInfos(); i < n; ++i) {
|
for (unsigned i = 0, n = Streamer.getNumFrameInfos(); i < n; ++i) {
|
||||||
const MCDwarfFrameInfo &Frame = Streamer.getFrameInfo(i);
|
const MCDwarfFrameInfo &Frame = Streamer.getFrameInfo(i);
|
||||||
if (!Frame.CompactUnwindEncoding ||
|
if (!Frame.CompactUnwindEncoding)
|
||||||
!Emitter.EmitCompactUnwind(Streamer, Frame))
|
Emitter.EmitCompactUnwind(Streamer, Frame);
|
||||||
RequiresFDE.push_back(Streamer.getFrameInfo(i));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Early exit if we don't need to emit FDEs.
|
|
||||||
if (RequiresFDE.empty()) return;
|
|
||||||
FrameArray = RequiresFDE;
|
|
||||||
} else {
|
|
||||||
FrameArray = Streamer.getFrameInfos();
|
|
||||||
}
|
|
||||||
|
|
||||||
const MCSection &Section = IsEH ? *MOFI->getEHFrameSection() :
|
const MCSection &Section = IsEH ? *MOFI->getEHFrameSection() :
|
||||||
*MOFI->getDwarfFrameSection();
|
*MOFI->getDwarfFrameSection();
|
||||||
Streamer.SwitchSection(&Section);
|
Streamer.SwitchSection(&Section);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user