aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/IntrinsicLowering.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-05-08 19:46:29 +0000
committerChris Lattner <sabre@nondot.org>2005-05-08 19:46:29 +0000
commit1f243e9f43e3552c28331c2e17b7c19bdfc889f6 (patch)
tree35c5a8fae51ff2c4e3b22856d1b3304165aa592f /lib/CodeGen/IntrinsicLowering.cpp
parent109d34d6ff51a0fdd39d7b3b373a83fcca6c67a3 (diff)
Wrap long lines. Fix "warning: conflicting types for built-in function 'memset'"
warning from the CBE+GCC. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21779 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/IntrinsicLowering.cpp')
-rw-r--r--lib/CodeGen/IntrinsicLowering.cpp23
1 files changed, 15 insertions, 8 deletions
diff --git a/lib/CodeGen/IntrinsicLowering.cpp b/lib/CodeGen/IntrinsicLowering.cpp
index 0bad510324..49dd809193 100644
--- a/lib/CodeGen/IntrinsicLowering.cpp
+++ b/lib/CodeGen/IntrinsicLowering.cpp
@@ -88,13 +88,16 @@ void DefaultIntrinsicLowering::AddPrototypes(Module &M) {
switch (I->getIntrinsicID()) {
default: break;
case Intrinsic::setjmp:
- EnsureFunctionExists(M, "setjmp", I->arg_begin(), I->arg_end(), Type::IntTy);
+ EnsureFunctionExists(M, "setjmp", I->arg_begin(), I->arg_end(),
+ Type::IntTy);
break;
case Intrinsic::longjmp:
- EnsureFunctionExists(M, "longjmp", I->arg_begin(), I->arg_end(),Type::VoidTy);
+ EnsureFunctionExists(M, "longjmp", I->arg_begin(), I->arg_end(),
+ Type::VoidTy);
break;
case Intrinsic::siglongjmp:
- EnsureFunctionExists(M, "abort", I->arg_end(), I->arg_end(), Type::VoidTy);
+ EnsureFunctionExists(M, "abort", I->arg_end(), I->arg_end(),
+ Type::VoidTy);
break;
case Intrinsic::memcpy:
EnsureFunctionExists(M, "memcpy", I->arg_begin(), --I->arg_end(),
@@ -105,17 +108,21 @@ void DefaultIntrinsicLowering::AddPrototypes(Module &M) {
I->arg_begin()->getType());
break;
case Intrinsic::memset:
- EnsureFunctionExists(M, "memset", I->arg_begin(), --I->arg_end(),
- I->arg_begin()->getType());
+ M.getOrInsertFunction("memset", PointerType::get(Type::SByteTy),
+ PointerType::get(Type::SByteTy),
+ Type::IntTy, (--(--I->arg_end()))->getType(), 0);
break;
case Intrinsic::isunordered:
- EnsureFunctionExists(M, "isunordered", I->arg_begin(), I->arg_end(), Type::BoolTy);
+ EnsureFunctionExists(M, "isunordered", I->arg_begin(), I->arg_end(),
+ Type::BoolTy);
break;
case Intrinsic::sqrt:
if(I->arg_begin()->getType() == Type::FloatTy)
- EnsureFunctionExists(M, "sqrtf", I->arg_begin(), I->arg_end(), Type::FloatTy);
+ EnsureFunctionExists(M, "sqrtf", I->arg_begin(), I->arg_end(),
+ Type::FloatTy);
else
- EnsureFunctionExists(M, "sqrt", I->arg_begin(), I->arg_end(), Type::DoubleTy);
+ EnsureFunctionExists(M, "sqrt", I->arg_begin(), I->arg_end(),
+ Type::DoubleTy);
break;
}
}