summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/IntrinsicLowering.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-01-13 02:22:08 +0000
committerChris Lattner <sabre@nondot.org>2006-01-13 02:22:08 +0000
commit3b2b0aff0cb06eb622182968d33946818c4a1b09 (patch)
treeec8949e56ef82215d83e37cbf2e51379d27312eb /llvm/lib/CodeGen/IntrinsicLowering.cpp
parentc482f16da127124270e63a1e429a564266557c0a (diff)
downloadbcm5719-llvm-3b2b0aff0cb06eb622182968d33946818c4a1b09.tar.gz
bcm5719-llvm-3b2b0aff0cb06eb622182968d33946818c4a1b09.zip
Add "support" for the llvm.stacksave/stackrestore intrinsics, this is
used by the C backend. llvm-svn: 25267
Diffstat (limited to 'llvm/lib/CodeGen/IntrinsicLowering.cpp')
-rw-r--r--llvm/lib/CodeGen/IntrinsicLowering.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/llvm/lib/CodeGen/IntrinsicLowering.cpp b/llvm/lib/CodeGen/IntrinsicLowering.cpp
index 256f0ffa567..08414a07a2e 100644
--- a/llvm/lib/CodeGen/IntrinsicLowering.cpp
+++ b/llvm/lib/CodeGen/IntrinsicLowering.cpp
@@ -248,6 +248,19 @@ void DefaultIntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
break;
}
+ case Intrinsic::stacksave:
+ case Intrinsic::stackrestore: {
+ static bool Warned = false;
+ if (!Warned)
+ std::cerr << "WARNING: this target does not support the llvm.stack"
+ << (Callee->getIntrinsicID() == Intrinsic::stacksave ?
+ "save" : "restore") << " intrinsic.\n";
+ Warned = true;
+ if (Callee->getIntrinsicID() == Intrinsic::stacksave)
+ CI->replaceAllUsesWith(Constant::getNullValue(CI->getType()));
+ break;
+ }
+
case Intrinsic::returnaddress:
case Intrinsic::frameaddress:
std::cerr << "WARNING: this target does not support the llvm."
@@ -263,8 +276,8 @@ void DefaultIntrinsicLowering::LowerIntrinsicCall(CallInst *CI) {
case Intrinsic::pcmarker:
break; // Simply strip out pcmarker on unsupported architectures
case Intrinsic::readcyclecounter: {
- std::cerr << "WARNING: this target does not support the llvm.readcyclecounter"
- << " intrinsic. It is being lowered to a constant 0\n";
+ std::cerr << "WARNING: this target does not support the llvm.readcyclecoun"
+ << "ter intrinsic. It is being lowered to a constant 0\n";
CI->replaceAllUsesWith(ConstantUInt::get(Type::ULongTy, 0));
break;
}
OpenPOWER on IntegriCloud