[cfe-commits] r135390 - in /cfe/trunk/lib: CodeGen/CGBuiltin.cpp CodeGen/CodeGenTBAA.cpp Frontend/ASTUnit.cpp

Frits van Bommel fvbommel at gmail.com
Mon Jul 18 05:00:32 PDT 2011


Author: fvbommel
Date: Mon Jul 18 07:00:32 2011
New Revision: 135390

URL: http://llvm.org/viewvc/llvm-project?rev=135390&view=rev
Log:
Migrate LLVM and Clang to use the new makeArrayRef(...) functions where previously explicit non-default constructors were used.
Mostly mechanical with some manual reformatting.

Modified:
    cfe/trunk/lib/CodeGen/CGBuiltin.cpp
    cfe/trunk/lib/CodeGen/CodeGenTBAA.cpp
    cfe/trunk/lib/Frontend/ASTUnit.cpp

Modified: cfe/trunk/lib/CodeGen/CGBuiltin.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGBuiltin.cpp?rev=135390&r1=135389&r2=135390&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGBuiltin.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGBuiltin.cpp Mon Jul 18 07:00:32 2011
@@ -1457,8 +1457,7 @@
     Ops[2] = Builder.CreateBitCast(Ops[2], Ty);
     Ops[3] = Builder.CreateBitCast(Ops[3], Ty);
     Ops.push_back(GetPointeeAlignment(*this, E->getArg(1)));
-    Ops[1] = Builder.CreateCall(F,
-                                ArrayRef<Value *>(Ops.begin() + 1, Ops.end()),
+    Ops[1] = Builder.CreateCall(F, makeArrayRef(Ops.begin() + 1, Ops.end()),
                                 "vld2_lane");
     Ty = llvm::PointerType::getUnqual(Ops[1]->getType());
     Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
@@ -1471,8 +1470,7 @@
     Ops[3] = Builder.CreateBitCast(Ops[3], Ty);
     Ops[4] = Builder.CreateBitCast(Ops[4], Ty);
     Ops.push_back(GetPointeeAlignment(*this, E->getArg(1)));
-    Ops[1] = Builder.CreateCall(F,
-                                ArrayRef<Value *>(Ops.begin() + 1, Ops.end()),
+    Ops[1] = Builder.CreateCall(F, makeArrayRef(Ops.begin() + 1, Ops.end()),
                                 "vld3_lane");
     Ty = llvm::PointerType::getUnqual(Ops[1]->getType());
     Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
@@ -1486,8 +1484,7 @@
     Ops[4] = Builder.CreateBitCast(Ops[4], Ty);
     Ops[5] = Builder.CreateBitCast(Ops[5], Ty);
     Ops.push_back(GetPointeeAlignment(*this, E->getArg(1)));
-    Ops[1] = Builder.CreateCall(F,
-                                ArrayRef<Value *>(Ops.begin() + 1, Ops.end()),
+    Ops[1] = Builder.CreateCall(F, makeArrayRef(Ops.begin() + 1, Ops.end()),
                                 "vld3_lane");
     Ty = llvm::PointerType::getUnqual(Ops[1]->getType());
     Ops[0] = Builder.CreateBitCast(Ops[0], Ty);
@@ -2163,7 +2160,7 @@
       
       // create i32 constant
       llvm::Function *F = CGM.getIntrinsic(Intrinsic::x86_mmx_psrl_q);
-      return Builder.CreateCall(F, ArrayRef<Value *>(&Ops[0], 2), "palignr");
+      return Builder.CreateCall(F, makeArrayRef(&Ops[0], 2), "palignr");
     }
     
     // If palignr is shifting the pair of vectors more than 32 bytes, emit zero.
@@ -2193,7 +2190,7 @@
       
       // create i32 constant
       llvm::Function *F = CGM.getIntrinsic(Intrinsic::x86_sse2_psrl_dq);
-      return Builder.CreateCall(F, ArrayRef<Value *>(&Ops[0], 2), "palignr");
+      return Builder.CreateCall(F, makeArrayRef(&Ops[0], 2), "palignr");
     }
     
     // If palignr is shifting the pair of vectors more than 32 bytes, emit zero.

Modified: cfe/trunk/lib/CodeGen/CodeGenTBAA.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CodeGenTBAA.cpp?rev=135390&r1=135389&r2=135390&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CodeGenTBAA.cpp (original)
+++ cfe/trunk/lib/CodeGen/CodeGenTBAA.cpp Mon Jul 18 07:00:32 2011
@@ -75,7 +75,7 @@
 
   // Create the mdnode.
   unsigned Len = llvm::array_lengthof(Ops) - !Flags;
-  return llvm::MDNode::get(VMContext, llvm::ArrayRef<llvm::Value*>(Ops, Len));
+  return llvm::MDNode::get(VMContext, llvm::makeArrayRef(Ops, Len));
 }
 
 static bool TypeHasMayAlias(QualType QTy) {

Modified: cfe/trunk/lib/Frontend/ASTUnit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/ASTUnit.cpp?rev=135390&r1=135389&r2=135390&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/ASTUnit.cpp (original)
+++ cfe/trunk/lib/Frontend/ASTUnit.cpp Mon Jul 18 07:00:32 2011
@@ -1780,8 +1780,8 @@
                                       StoredDiagnostics);
 
     CI = clang::createInvocationFromCommandLine(
-                        llvm::ArrayRef<const char *>(ArgBegin, ArgEnd-ArgBegin),
-                        Diags);
+                                           llvm::makeArrayRef(ArgBegin, ArgEnd),
+                                           Diags);
     if (!CI)
       return 0;
   }





More information about the cfe-commits mailing list