llvm.org GIT mirror llvm / 7908480
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 Evgeniy Stepanov 8 years ago
4 changed file(s) with 26 addition(s) and 12 deletion(s). Raw diff Collapse all Expand all
2929
3030 namespace ExceptionHandling {
3131 enum ExceptionsType { None, DwarfCFI, SjLj, ARM, Win64 };
32 enum ARMEHABIMode { ARMEHABIDisabled, ARMEHABIUnwind, ARMEHABIFull };
3233 }
3334
3435 namespace LCOMM {
2828 #include "llvm/Target/TargetMachine.h"
2929 #include "llvm/Target/TargetOptions.h"
3030 #include "llvm/Target/TargetRegisterInfo.h"
31 #include "llvm/Support/CommandLine.h"
3132 #include "llvm/Support/Dwarf.h"
3233 #include "llvm/Support/FormattedStream.h"
3334 #include "llvm/ADT/SmallString.h"
3435 #include "llvm/ADT/StringExtras.h"
3536 #include "llvm/ADT/Twine.h"
3637 using namespace llvm;
38
39 cl::opt
40 EnableARMEHABI("arm-enable-ehabi", cl::Hidden,
41 cl::desc("Generate ARM EHABI tables:"),
42 cl::values(clEnumValN(ExceptionHandling::ARMEHABIDisabled, "no",
43 "Do not generate ARM EHABI tables"),
44 clEnumValN(ExceptionHandling::ARMEHABIUnwind, "unwind",
45 "Emit unwinding instructions, but not descriptors"),
46 clEnumValN(ExceptionHandling::ARMEHABIFull, "full",
47 "Generate full ARM EHABI tables"),
48 clEnumValEnd));
49
3750
3851 ARMException::ARMException(AsmPrinter *A)
3952 : DwarfException(A),
7184 Asm->OutStreamer.EmitPersonality(PerSym);
7285 }
7386
74 // Map all labels and get rid of any dead landing pads.
75 MMI->TidyLandingPads();
87 if (EnableARMEHABI == ExceptionHandling::ARMEHABIFull) {
88 // Map all labels and get rid of any dead landing pads.
89 MMI->TidyLandingPads();
7690
77 Asm->OutStreamer.EmitHandlerData();
91 Asm->OutStreamer.EmitHandlerData();
7892
79 // Emit actual exception table
80 EmitExceptionTable();
93 // Emit actual exception table
94 EmitExceptionTable();
95 }
8196 }
8297
8398 Asm->OutStreamer.EmitFnEnd();
1515
1616 using namespace llvm;
1717
18 cl::opt
19 EnableARMEHABI("arm-enable-ehabi", cl::Hidden,
20 cl::desc("Generate ARM EHABI tables"),
21 cl::init(false));
18 extern cl::opt EnableARMEHABI;
2219
2320
2421 static const char *const arm_asm_table[] = {
8178 SupportsDebugInformation = true;
8279
8380 // Exceptions handling
84 if (EnableARMEHABI)
81 if (EnableARMEHABI != ExceptionHandling::ARMEHABIDisabled)
8582 ExceptionsType = ExceptionHandling::ARM;
8683 }
0 ; Test that the EHABI unwind instruction generator does not encounter any
11 ; unfamiliar instructions.
2 ; RUN: llc < %s -mtriple=thumbv7 -arm-enable-ehabi -disable-fp-elim
3 ; RUN: llc < %s -mtriple=thumbv7 -arm-enable-ehabi
2 ; RUN: llc < %s -mtriple=thumbv7 -arm-enable-ehabi=full -disable-fp-elim
3 ; RUN: llc < %s -mtriple=thumbv7 -arm-enable-ehabi=full
4 ; RUN: llc < %s -mtriple=thumbv7 -arm-enable-ehabi=unwind
45
56 define void @_Z1fv() nounwind {
67 entry: