diff options
author | Evan Cheng <evan.cheng@apple.com> | 2011-04-08 21:37:21 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2011-04-08 21:37:21 +0000 |
commit | 4da0c7c0c9081107bea5f6bac440f0f1eb47748f (patch) | |
tree | 0602fc33efe0ffceae34ab44129adbfce7d62239 /lib/Target/TargetMachine.cpp | |
parent | e2e777b0e73809047d98066ebcc28042882d1cf8 (diff) | |
download | llvm-4da0c7c0c9081107bea5f6bac440f0f1eb47748f.tar.gz llvm-4da0c7c0c9081107bea5f6bac440f0f1eb47748f.tar.bz2 llvm-4da0c7c0c9081107bea5f6bac440f0f1eb47748f.tar.xz |
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.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@129152 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/TargetMachine.cpp')
-rw-r--r-- | lib/Target/TargetMachine.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/Target/TargetMachine.cpp b/lib/Target/TargetMachine.cpp index 8c7330a77c..93eae250df 100644 --- a/lib/Target/TargetMachine.cpp +++ b/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; + } } |