diff options
author | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2012-01-23 07:57:39 +0000 |
---|---|---|
committer | Evgeniy Stepanov <eugeni.stepanov@gmail.com> | 2012-01-23 07:57:39 +0000 |
commit | 7908480e4caf2f7ecb0b62c900039d49e7d51ebb (patch) | |
tree | 2e7cb2eef73a87bb3dde5844f065c1937cf3573b /lib/CodeGen/AsmPrinter/ARMException.cpp | |
parent | 7fb8b0c5d3eab5047dbec08fe46916e9c09f768c (diff) |
An option to selectively enable parts of ARM EHABI support.
This change adds an new value to the --arm-enable-ehabi option that
disables emitting unwinding descriptors. This mode gives a working
backtrace() without the (currently broken) exception support.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@148686 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter/ARMException.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter/ARMException.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/lib/CodeGen/AsmPrinter/ARMException.cpp b/lib/CodeGen/AsmPrinter/ARMException.cpp index 3f23873253..e5a7d05f4c 100644 --- a/lib/CodeGen/AsmPrinter/ARMException.cpp +++ b/lib/CodeGen/AsmPrinter/ARMException.cpp @@ -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,18 @@ #include "llvm/ADT/Twine.h" using namespace llvm; +cl::opt<ExceptionHandling::ARMEHABIMode> +EnableARMEHABI("arm-enable-ehabi", cl::Hidden, + cl::desc("Generate ARM EHABI tables:"), + cl::values(clEnumValN(ExceptionHandling::ARMEHABIDisabled, "no", + "Do not generate ARM EHABI tables"), + clEnumValN(ExceptionHandling::ARMEHABIUnwind, "unwind", + "Emit unwinding instructions, but not descriptors"), + clEnumValN(ExceptionHandling::ARMEHABIFull, "full", + "Generate full ARM EHABI tables"), + clEnumValEnd)); + + ARMException::ARMException(AsmPrinter *A) : DwarfException(A), shouldEmitTable(false), shouldEmitMoves(false), shouldEmitTableModule(false) @@ -72,13 +85,15 @@ void ARMException::EndFunction() { Asm->OutStreamer.EmitPersonality(PerSym); } - // Map all labels and get rid of any dead landing pads. - MMI->TidyLandingPads(); + if (EnableARMEHABI == ExceptionHandling::ARMEHABIFull) { + // 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(); |