diff options
author | Chris Lattner <sabre@nondot.org> | 2006-01-13 02:22:08 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-01-13 02:22:08 +0000 |
commit | 0c067bc11d5274973c21f83b6c6403a9928265d8 (patch) | |
tree | 44cf95fd3aa59a7abc7167d9039aef3b40eaff60 /lib/CodeGen/IntrinsicLowering.cpp | |
parent | 71d0e3de8de94f107e62db99eebae1d83bd24c94 (diff) |
Add "support" for the llvm.stacksave/stackrestore intrinsics, this is
used by the C backend.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@25267 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/IntrinsicLowering.cpp')
-rw-r--r-- | lib/CodeGen/IntrinsicLowering.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp index 256f0ffa56..08414a07a2 100644 --- a/lib/CodeGen/IntrinsicLowering.cpp +++ b/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; } |