[llvm-commits] [llvm-gcc-4.2] r100303 - /llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Mon P Wang wangmp at apple.com
Sat Apr 3 20:10:45 PDT 2010


Author: wangmp
Date: Sat Apr  3 22:10:45 2010
New Revision: 100303

URL: http://llvm.org/viewvc/llvm-project?rev=100303&view=rev
Log:
Reapply patch for adding support for address spaces and added a isVolatile field to memcpy, memmove, and memset.

Modified:
    llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp

Modified: llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp?rev=100303&r1=100302&r2=100303&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp (original)
+++ llvm-gcc-4.2/trunk/gcc/llvm-convert.cpp Sat Apr  3 22:10:45 2010
@@ -1559,15 +1559,17 @@
                               unsigned Align) {
   const Type *SBP = Type::getInt8PtrTy(Context);
   const Type *IntPtr = TD.getIntPtrType(Context);
-  Value *Ops[4] = {
+  Value *Ops[5] = {
     BitCastToType(DestPtr, SBP),
     BitCastToType(SrcPtr, SBP),
     CastToSIntType(Size, IntPtr),
-    ConstantInt::get(Type::getInt32Ty(Context), Align)
+    ConstantInt::get(Type::getInt32Ty(Context), Align),
+    ConstantInt::get(Type::getInt1Ty(Context), false)
   };
 
+  const Type *ArgTypes[3] = {SBP, SBP, IntPtr };
   Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::memcpy,
-                                               &IntPtr, 1), Ops, Ops+4);
+                                               ArgTypes, 3), Ops, Ops+5);
   return Ops[0];
 }
 
@@ -1575,15 +1577,17 @@
                                unsigned Align) {
   const Type *SBP = Type::getInt8PtrTy(Context);
   const Type *IntPtr = TD.getIntPtrType(Context);
-  Value *Ops[4] = {
+  Value *Ops[5] = {
     BitCastToType(DestPtr, SBP),
     BitCastToType(SrcPtr, SBP),
     CastToSIntType(Size, IntPtr),
-    ConstantInt::get(Type::getInt32Ty(Context), Align)
+    ConstantInt::get(Type::getInt32Ty(Context), Align),
+    ConstantInt::get(Type::getInt1Ty(Context), false)
   };
+  const Type *ArgTypes[3] = {SBP, SBP, IntPtr };
 
   Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::memmove,
-                                               &IntPtr, 1), Ops, Ops+4);
+                                               ArgTypes, 3), Ops, Ops+5);
   return Ops[0];
 }
 
@@ -1591,15 +1595,17 @@
                               unsigned Align) {
   const Type *SBP = Type::getInt8PtrTy(Context);
   const Type *IntPtr = TD.getIntPtrType(Context);
-  Value *Ops[4] = {
+  Value *Ops[5] = {
     BitCastToType(DestPtr, SBP),
     CastToSIntType(SrcVal, Type::getInt8Ty(Context)),
     CastToSIntType(Size, IntPtr),
-    ConstantInt::get(Type::getInt32Ty(Context), Align)
+    ConstantInt::get(Type::getInt32Ty(Context), Align),
+    ConstantInt::get(Type::getInt1Ty(Context), false)
   };
 
+  const Type *ArgTypes[2] = {SBP, IntPtr };
   Builder.CreateCall(Intrinsic::getDeclaration(TheModule, Intrinsic::memset,
-                                               &IntPtr, 1), Ops, Ops+4);
+                                               ArgTypes, 2), Ops, Ops+5);
   return Ops[0];
 }
 





More information about the llvm-commits mailing list