[llvm-commits] CVS: llvm/lib/VMCore/AutoUpgrade.cpp

Chris Lattner lattner at cs.uiuc.edu
Thu Mar 9 10:42:22 PST 2006



Changes in directory llvm/lib/VMCore:

AutoUpgrade.cpp updated: 1.10 -> 1.11
---
Log message:

autoupgrade memcpy/memmove/memset with signed counts.
 CVS: ----------------------------------------------------------------------


---
Diffs of the changes:  (+12 -4)

 AutoUpgrade.cpp |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)


Index: llvm/lib/VMCore/AutoUpgrade.cpp
diff -u llvm/lib/VMCore/AutoUpgrade.cpp:1.10 llvm/lib/VMCore/AutoUpgrade.cpp:1.11
--- llvm/lib/VMCore/AutoUpgrade.cpp:1.10	Fri Mar  3 10:31:22 2006
+++ llvm/lib/VMCore/AutoUpgrade.cpp	Thu Mar  9 12:42:10 2006
@@ -84,10 +84,18 @@
   case 'm':
     if (Name == "llvm.memcpy" || Name == "llvm.memset" || 
         Name == "llvm.memmove") {
-      if (F->getFunctionType()->getParamType(2) == Type::UIntTy)
-        return M->getOrInsertFunction(Name+".i32", F->getFunctionType());
-      if (F->getFunctionType()->getParamType(2) == Type::ULongTy)
-        return M->getOrInsertFunction(Name+".i64", F->getFunctionType());
+      if (F->getFunctionType()->getParamType(2) == Type::UIntTy ||
+          F->getFunctionType()->getParamType(2) == Type::IntTy)
+        return M->getOrInsertFunction(Name+".i32", Type::VoidTy,
+                                      PointerType::get(Type::SByteTy),
+                                      F->getFunctionType()->getParamType(1),
+                                      Type::UIntTy, Type::UIntTy, NULL);
+      if (F->getFunctionType()->getParamType(2) == Type::ULongTy ||
+          F->getFunctionType()->getParamType(2) == Type::LongTy)
+        return M->getOrInsertFunction(Name+".i64", Type::VoidTy,
+                                      PointerType::get(Type::SByteTy),
+                                      F->getFunctionType()->getParamType(1),
+                                      Type::ULongTy, Type::UIntTy, NULL);
     }
     break;
   case 's':






More information about the llvm-commits mailing list