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 | 482cdc4ebd0e3a8c87bb555e155f5c7b574b5a88 (patch) | |
tree | 5cb08e18ac7f1623b87dc188843ce2eb68f34052 /llvm/lib/CodeGen | |
parent | 6b90c5d03e6e22c2e012bb7952244ce32e22063e (diff) | |
download | bcm5719-llvm-482cdc4ebd0e3a8c87bb555e155f5c7b574b5a88.tar.gz bcm5719-llvm-482cdc4ebd0e3a8c87bb555e155f5c7b574b5a88.zip |
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.
llvm-svn: 148686
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter/ARMException.cpp | 25 |
1 files changed, 20 insertions, 5 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp b/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp index 3f238732536..e5a7d05f4c5 100644 --- a/llvm/lib/CodeGen/AsmPrinter/ARMException.cpp +++ b/llvm/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(); |