summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/TargetMachine.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-04-08 21:37:21 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-04-08 21:37:21 +0000
commit74d92c19247067189b2d62854cad16dae0487068 (patch)
tree56b403bcc0fd56f65c58a91a4975527994364fb4 /llvm/lib/Target/TargetMachine.cpp
parentecd7043883c79d87d737001d8e1d780d50cfc8ac (diff)
downloadbcm5719-llvm-74d92c19247067189b2d62854cad16dae0487068.tar.gz
bcm5719-llvm-74d92c19247067189b2d62854cad16dae0487068.zip
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
Diffstat (limited to 'llvm/lib/Target/TargetMachine.cpp')
-rw-r--r--llvm/lib/Target/TargetMachine.cpp11
1 files changed, 11 insertions, 0 deletions
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<std::string>
+TrapFuncName("trap-func", cl::Hidden,
+ cl::desc("Emit a call to trap function rather than a trap instruction"),
+ cl::init(""));
static cl::opt<bool>
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;
+ }
}
OpenPOWER on IntegriCloud