[llvm-commits] [llvm] r148800 - in /llvm/trunk: lib/CodeGen/AsmPrinter/ARMException.cpp test/CodeGen/ARM/ehabi-unwind.ll

Evgeniy Stepanov eugeni.stepanov at gmail.com
Tue Jan 24 05:05:34 PST 2012


Author: eugenis
Date: Tue Jan 24 07:05:33 2012
New Revision: 148800

URL: http://llvm.org/viewvc/llvm-project?rev=148800&view=rev
Log:
An option to selectively enable part of ARM EHABI support.

This change adds an new option --arm-enable-ehabi-descriptors that
enables emitting unwinding descriptors. This provides a mode with a
working backtrace() without the (currently broken) exception support.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/ARMException.cpp
    llvm/trunk/test/CodeGen/ARM/ehabi-unwind.ll

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/ARMException.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/ARMException.cpp?rev=148800&r1=148799&r2=148800&view=diff
==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/ARMException.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/ARMException.cpp Tue Jan 24 07:05:33 2012
@@ -29,6 +29,7 @@
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Target/TargetOptions.h"
 #include "llvm/Target/TargetRegisterInfo.h"
+#include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Dwarf.h"
 #include "llvm/Support/FormattedStream.h"
 #include "llvm/ADT/SmallString.h"
@@ -36,6 +37,12 @@
 #include "llvm/ADT/Twine.h"
 using namespace llvm;
 
+cl::opt<bool>
+EnableARMEHABIDescriptors("arm-enable-ehabi-descriptors", cl::Hidden,
+  cl::desc("Generate ARM EHABI tables with unwinding descriptors"),
+  cl::init(false));
+
+
 ARMException::ARMException(AsmPrinter *A)
   : DwarfException(A),
     shouldEmitTable(false), shouldEmitMoves(false), shouldEmitTableModule(false)
@@ -72,13 +79,15 @@
       Asm->OutStreamer.EmitPersonality(PerSym);
     }
 
-    // Map all labels and get rid of any dead landing pads.
-    MMI->TidyLandingPads();
+    if (EnableARMEHABIDescriptors) {
+      // Map all labels and get rid of any dead landing pads.
+      MMI->TidyLandingPads();
 
-    Asm->OutStreamer.EmitHandlerData();
+      Asm->OutStreamer.EmitHandlerData();
 
-    // Emit actual exception table
-    EmitExceptionTable();
+      // Emit actual exception table
+      EmitExceptionTable();
+    }
   }
 
   Asm->OutStreamer.EmitFnEnd();

Modified: llvm/trunk/test/CodeGen/ARM/ehabi-unwind.ll
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/CodeGen/ARM/ehabi-unwind.ll?rev=148800&r1=148799&r2=148800&view=diff
==============================================================================
--- llvm/trunk/test/CodeGen/ARM/ehabi-unwind.ll (original)
+++ llvm/trunk/test/CodeGen/ARM/ehabi-unwind.ll Tue Jan 24 07:05:33 2012
@@ -2,6 +2,7 @@
 ; unfamiliar instructions.
 ; RUN: llc < %s -mtriple=thumbv7 -arm-enable-ehabi -disable-fp-elim
 ; RUN: llc < %s -mtriple=thumbv7 -arm-enable-ehabi
+; RUN: llc < %s -mtriple=thumbv7 -arm-enable-ehabi -arm-enable-ehabi-descriptors
 
 define void @_Z1fv() nounwind {
 entry:





More information about the llvm-commits mailing list