[llvm-commits] CVS: llvm/lib/CodeGen/IntrinsicLowering.cpp

Chris Lattner lattner at cs.uiuc.edu
Sun May 8 12:46:43 PDT 2005



Changes in directory llvm/lib/CodeGen:

IntrinsicLowering.cpp updated: 1.29 -> 1.30
---
Log message:

Wrap long lines.  Fix "warning: conflicting types for built-in function 'memset'"
warning from the CBE+GCC.


---
Diffs of the changes:  (+15 -8)

 IntrinsicLowering.cpp |   23 +++++++++++++++--------
 1 files changed, 15 insertions(+), 8 deletions(-)


Index: llvm/lib/CodeGen/IntrinsicLowering.cpp
diff -u llvm/lib/CodeGen/IntrinsicLowering.cpp:1.29 llvm/lib/CodeGen/IntrinsicLowering.cpp:1.30
--- llvm/lib/CodeGen/IntrinsicLowering.cpp:1.29	Tue May  3 12:19:29 2005
+++ llvm/lib/CodeGen/IntrinsicLowering.cpp	Sun May  8 14:46:29 2005
@@ -88,13 +88,16 @@
       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 @@
                              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;
       }
 }






More information about the llvm-commits mailing list