Changes in directory llvm-gcc/gcc:

llvm-expand.c updated: 1.127 -> 1.128
---
Log message:

Add appropriate type suffix for llvm.memset also, for PR733: 
http://llvm.cs.uiuc.edu/PR733 


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

 llvm-expand.c |   14 ++++++++++----
 1 files changed, 10 insertions(+), 4 deletions(-)


Index: llvm-gcc/gcc/llvm-expand.c
diff -u llvm-gcc/gcc/llvm-expand.c:1.127 llvm-gcc/gcc/llvm-expand.c:1.128
--- llvm-gcc/gcc/llvm-expand.c:1.127    Thu Apr 13 13:17:55 2006
+++ llvm-gcc/gcc/llvm-expand.c  Thu Apr 13 13:21:13 2006
@@ -344,11 +344,11 @@
                            unsigned Alignment, int isMove) {
   static llvm_function *llvm_memcpy_fn = 0, *llvm_memmove_fn = 0;
   static llvm_type *size_tTy = 0;
+  llvm_instruction *I;
   
   if (size_tTy == 0)
     size_tTy = llvm_type_get_from_tree(size_type_node);
   
-  llvm_instruction *I;
   if (!isMove && !llvm_memcpy_fn) {
     const char *Name = size_tTy == UIntTy ? 
        "llvm.memcpy.i32" : "llvm.memcpy.i64";
@@ -387,16 +387,22 @@
                        llvm_value *Size, unsigned Alignment) {
   static llvm_function *llvm_memset_fn = 0;
   static llvm_type *size_tTy = 0;
-
   llvm_instruction *I;
+
+  if (size_tTy == 0)
+    size_tTy = llvm_type_get_from_tree(size_type_node);
+
   if (!llvm_memset_fn) {
+    const char *Name = size_tTy == UIntTy ? 
+      "llvm.memset.i32" : "llvm.memset.i64";
+
     llvm_type *FnTy = llvm_type_create_function(4, VoidTy);
     FnTy->Elements[1] = VoidPtrTy;
     FnTy->Elements[2] = UByteTy;
-    FnTy->Elements[3] = size_tTy = llvm_type_get_from_tree(size_type_node);
+    FnTy->Elements[3] = size_tTy;
     FnTy->Elements[4] = UIntTy;
     FnTy = llvm_type_get_cannonical_function(FnTy);
-    llvm_memset_fn = CreateIntrinsicFnWithType("llvm.memset", FnTy);
+    llvm_memset_fn = CreateIntrinsicFnWithType(Name, FnTy);
   }
   
   I = llvm_instruction_new(VoidTy, "", O_Call, 5);



_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to