Add CFIStartSections to the asm printer. Add an assert that at least

one of the sections is created.

llvm-svn: 131124
This commit is contained in:
Rafael Espindola 2011-05-10 13:39:48 +00:00
parent ecdabf3295
commit 33cc7a8f74
2 changed files with 20 additions and 0 deletions

View File

@ -193,6 +193,7 @@ public:
unsigned Isa, unsigned Discriminator,
StringRef FileName);
virtual void EmitCFISections(bool EH, bool Debug);
virtual void EmitCFIStartProc();
virtual void EmitCFIEndProc();
virtual void EmitCFIDefCfa(int64_t Register, int64_t Offset);
@ -764,6 +765,24 @@ void MCAsmStreamer::EmitDwarfLocDirective(unsigned FileNo, unsigned Line,
EmitEOL();
}
void MCAsmStreamer::EmitCFISections(bool EH, bool Debug) {
MCStreamer::EmitCFISections(EH, Debug);
if (!UseCFI)
return;
OS << "\t.cfi_sections ";
if (EH) {
OS << ".eh_frame";
if (Debug)
OS << ", .debug_frame";
} else if (Debug) {
OS << ".debug_frame";
}
EmitEOL();
}
void MCAsmStreamer::EmitCFIStartProc() {
MCStreamer::EmitCFIStartProc();

View File

@ -178,6 +178,7 @@ void MCStreamer::EmitLabel(MCSymbol *Symbol) {
}
void MCStreamer::EmitCFISections(bool EH, bool Debug) {
assert(EH || Debug);
EmitEHFrame = EH;
EmitDebugFrame = Debug;
}