aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2011-05-10 13:39:48 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2011-05-10 13:39:48 +0000
commit713c4bfc36260bfc9273d414b14757bd7819f9b1 (patch)
tree3dfa639483346de56c16191a54119c14c0287827
parent0d1097078934744fd223b3825dc94799e93ef775 (diff)
Add CFIStartSections to the asm printer. Add an assert that at least
one of the sections is created. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@131124 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/MC/MCAsmStreamer.cpp19
-rw-r--r--lib/MC/MCStreamer.cpp1
2 files changed, 20 insertions, 0 deletions
diff --git a/lib/MC/MCAsmStreamer.cpp b/lib/MC/MCAsmStreamer.cpp
index c7fc190b87..603ae837b6 100644
--- a/lib/MC/MCAsmStreamer.cpp
+++ b/lib/MC/MCAsmStreamer.cpp
@@ -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();
diff --git a/lib/MC/MCStreamer.cpp b/lib/MC/MCStreamer.cpp
index 689e408a1a..9b644a91bd 100644
--- a/lib/MC/MCStreamer.cpp
+++ b/lib/MC/MCStreamer.cpp
@@ -178,6 +178,7 @@ void MCStreamer::EmitLabel(MCSymbol *Symbol) {
}
void MCStreamer::EmitCFISections(bool EH, bool Debug) {
+ assert(EH || Debug);
EmitEHFrame = EH;
EmitDebugFrame = Debug;
}