From 74d92c19247067189b2d62854cad16dae0487068 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Fri, 8 Apr 2011 21:37:21 +0000 Subject: Change -arm-trap-func= into a non-arm specific option. Now Intrinsic::trap is lowered into a call to the specified trap function at sdisel time. llvm-svn: 129152 --- llvm/lib/Target/TargetMachine.cpp | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'llvm/lib/Target/TargetMachine.cpp') diff --git a/llvm/lib/Target/TargetMachine.cpp b/llvm/lib/Target/TargetMachine.cpp index 8c7330a77c7..93eae250dfc 100644 --- a/llvm/lib/Target/TargetMachine.cpp +++ b/llvm/lib/Target/TargetMachine.cpp @@ -211,6 +211,10 @@ UseDivMod("use-divmod-libcall", cl::desc("Use __{u}divmod libcalls for div / rem pairs"), cl::location(HasDivModLibcall), cl::init(false)); +static cl::opt +TrapFuncName("trap-func", cl::Hidden, + cl::desc("Emit a call to trap function rather than a trap instruction"), + cl::init("")); static cl::opt DataSections("fdata-sections", cl::desc("Emit data into separate sections"), @@ -310,4 +314,11 @@ namespace llvm { bool HonorSignDependentRoundingFPMath() { return !UnsafeFPMath && HonorSignDependentRoundingFPMathOption; } + + /// getTrapFunctionName - If this returns a non-empty string, this means isel + /// should lower Intrinsic::trap to a call to the specified function name + /// instead of an ISD::TRAP node. + StringRef getTrapFunctionName() { + return TrapFuncName; + } } -- cgit v1.2.3