[llvm-commits] [llvm] r131124 - in /llvm/trunk/lib/MC: MCAsmStreamer.cpp MCStreamer.cpp

Rafael Espindola rafael.espindola at gmail.com
Tue May 10 06:39:48 PDT 2011


Author: rafael
Date: Tue May 10 08:39:48 2011
New Revision: 131124

URL: http://llvm.org/viewvc/llvm-project?rev=131124&view=rev
Log:
Add CFIStartSections to the asm printer. Add an assert that at least
one of the sections is created.

Modified:
    llvm/trunk/lib/MC/MCAsmStreamer.cpp
    llvm/trunk/lib/MC/MCStreamer.cpp

Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=131124&r1=131123&r2=131124&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Tue May 10 08:39:48 2011
@@ -193,6 +193,7 @@
                                      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 @@
   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();
 

Modified: llvm/trunk/lib/MC/MCStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCStreamer.cpp?rev=131124&r1=131123&r2=131124&view=diff
==============================================================================
--- llvm/trunk/lib/MC/MCStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCStreamer.cpp Tue May 10 08:39:48 2011
@@ -178,6 +178,7 @@
 }
 
 void MCStreamer::EmitCFISections(bool EH, bool Debug) {
+  assert(EH || Debug);
   EmitEHFrame = EH;
   EmitDebugFrame = Debug;
 }





More information about the llvm-commits mailing list