forked from OSchip/llvm-project
[Hexagon] Add option to generate calls to "abort" for "unreachable"
llvm-svn: 312644
This commit is contained in:
parent
bdc3e61d21
commit
daf1a5f94e
|
@ -91,6 +91,10 @@ static cl::opt<bool> EnableVectorPrint("enable-hexagon-vector-print",
|
|||
cl::Hidden, cl::ZeroOrMore, cl::init(false),
|
||||
cl::desc("Enable Hexagon Vector print instr pass"));
|
||||
|
||||
static cl::opt<bool> EnableTrapUnreachable("hexagon-trap-unreachable",
|
||||
cl::Hidden, cl::ZeroOrMore, cl::init(false),
|
||||
cl::desc("Enable generating trap for unreachable"));
|
||||
|
||||
/// HexagonTargetMachineModule - Note that this is used on hosts that
|
||||
/// cannot link in a library unless there are references into the
|
||||
/// library. In particular, it seems that it is not possible to get
|
||||
|
@ -195,6 +199,8 @@ HexagonTargetMachine::HexagonTargetMachine(const Target &T, const Triple &TT,
|
|||
TT, CPU, FS, Options, getEffectiveRelocModel(RM),
|
||||
getEffectiveCodeModel(CM), (HexagonNoOpt ? CodeGenOpt::None : OL)),
|
||||
TLOF(make_unique<HexagonTargetObjectFile>()) {
|
||||
if (EnableTrapUnreachable)
|
||||
this->Options.TrapUnreachable = true;
|
||||
initializeHexagonExpandCondsetsPass(*PassRegistry::getPassRegistry());
|
||||
initAsmInfo();
|
||||
}
|
||||
|
|
|
@ -0,0 +1,8 @@
|
|||
; RUN: llc -march=hexagon -hexagon-trap-unreachable < %s | FileCheck %s
|
||||
; CHECK: call abort
|
||||
|
||||
define void @fred() #0 {
|
||||
unreachable
|
||||
}
|
||||
|
||||
attributes #0 = { nounwind }
|
Loading…
Reference in New Issue