[llvm] r205722 - Use .data() instead of &x[0]

Matt Arsenault Matthew.Arsenault at amd.com
Mon Apr 7 09:44:24 PDT 2014


Author: arsenm
Date: Mon Apr  7 11:44:24 2014
New Revision: 205722

URL: http://llvm.org/viewvc/llvm-project?rev=205722&view=rev
Log:
Use .data() instead of &x[0]

Modified:
    llvm/trunk/lib/Target/R600/AMDGPUISelLowering.cpp
    llvm/trunk/lib/Target/R600/R600ISelLowering.cpp

Modified: llvm/trunk/lib/Target/R600/AMDGPUISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/AMDGPUISelLowering.cpp?rev=205722&r1=205721&r2=205722&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/AMDGPUISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/R600/AMDGPUISelLowering.cpp Mon Apr  7 11:44:24 2014
@@ -397,8 +397,8 @@ SDValue AMDGPUTargetLowering::LowerConst
       Chains.push_back(LowerConstantInitializer(Init->getAggregateElement(i),
                        GV, Ptr, Chain, DAG));
     }
-    return DAG.getNode(ISD::TokenFactor, DL, MVT::Other, &Chains[0],
-                       Chains.size());
+    return DAG.getNode(ISD::TokenFactor, DL, MVT::Other,
+                       Chains.data(), Chains.size());
   } else {
     Init->dump();
     llvm_unreachable("Unhandled constant initializer");
@@ -461,7 +461,7 @@ SDValue AMDGPUTargetLowering::LowerGloba
       for (unsigned i = 1; i < (*I)->getNumOperands(); ++i) {
         Ops.push_back((*I)->getOperand(i));
       }
-      DAG.UpdateNodeOperands(*I, &Ops[0], Ops.size());
+      DAG.UpdateNodeOperands(*I, Ops.data(), Ops.size());
     }
     return DAG.getZExtOrTrunc(InitPtr, SDLoc(Op),
         getPointerTy(AMDGPUAS::CONSTANT_ADDRESS));
@@ -493,7 +493,7 @@ SDValue AMDGPUTargetLowering::LowerCONCA
                         B.getValueType().getVectorNumElements());
 
   return DAG.getNode(ISD::BUILD_VECTOR, SDLoc(Op), Op.getValueType(),
-                     &Args[0], Args.size());
+                     Args.data(), Args.size());
 }
 
 SDValue AMDGPUTargetLowering::LowerEXTRACT_SUBVECTOR(SDValue Op,
@@ -506,7 +506,7 @@ SDValue AMDGPUTargetLowering::LowerEXTRA
                         VT.getVectorNumElements());
 
   return DAG.getNode(ISD::BUILD_VECTOR, SDLoc(Op), Op.getValueType(),
-                     &Args[0], Args.size());
+                     Args.data(), Args.size());
 }
 
 SDValue AMDGPUTargetLowering::LowerFrameIndex(SDValue Op,
@@ -766,7 +766,7 @@ SDValue AMDGPUTargetLowering::SplitVecto
                          MemEltVT, Store->isVolatile(), Store->isNonTemporal(),
                          Store->getAlignment()));
   }
-  return DAG.getNode(ISD::TokenFactor, SL, MVT::Other, &Chains[0], NumElts);
+  return DAG.getNode(ISD::TokenFactor, SL, MVT::Other, Chains.data(), NumElts);
 }
 
 SDValue AMDGPUTargetLowering::LowerLOAD(SDValue Op, SelectionDAG &DAG) const {
@@ -985,9 +985,10 @@ SDValue AMDGPUTargetLowering::LowerUDIVR
   // Rem = (Remainder_GE_Zero == 0 ? Remainder_A_Den : Rem)
   Rem = DAG.getSelectCC(DL, Remainder_GE_Zero, DAG.getConstant(0, VT),
                             Remainder_A_Den, Rem, ISD::SETEQ);
-  SDValue Ops[2];
-  Ops[0] = Div;
-  Ops[1] = Rem;
+  SDValue Ops[2] = {
+    Div,
+    Rem
+  };
   return DAG.getMergeValues(Ops, 2, DL);
 }
 

Modified: llvm/trunk/lib/Target/R600/R600ISelLowering.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/R600ISelLowering.cpp?rev=205722&r1=205721&r2=205722&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/R600ISelLowering.cpp (original)
+++ llvm/trunk/lib/Target/R600/R600ISelLowering.cpp Mon Apr  7 11:44:24 2014
@@ -1212,9 +1212,10 @@ SDValue R600TargetLowering::LowerLOAD(SD
 
   SDValue Ret = AMDGPUTargetLowering::LowerLOAD(Op, DAG);
   if (Ret.getNode()) {
-    SDValue Ops[2];
-    Ops[0] = Ret;
-    Ops[1] = Chain;
+    SDValue Ops[2] = {
+      Ret,
+      Chain
+    };
     return DAG.getMergeValues(Ops, 2, DL);
   }
 
@@ -1268,8 +1269,8 @@ SDValue R600TargetLowering::LowerLOAD(SD
     }
 
     SDValue MergedValues[2] = {
-        Result,
-        Chain
+      Result,
+      Chain
     };
     return DAG.getMergeValues(MergedValues, 2, DL);
   }
@@ -1340,9 +1341,10 @@ SDValue R600TargetLowering::LowerLOAD(SD
                               Op.getOperand(2));
   }
 
-  SDValue Ops[2];
-  Ops[0] = LoweredLoad;
-  Ops[1] = Chain;
+  SDValue Ops[2] = {
+    LoweredLoad,
+    Chain
+  };
 
   return DAG.getMergeValues(Ops, 2, DL);
 }
@@ -1614,7 +1616,7 @@ SDValue R600TargetLowering::PerformDAGCo
 
     // Return the new vector
     return DAG.getNode(ISD::BUILD_VECTOR, dl,
-                       VT, &Ops[0], Ops.size());
+                       VT, Ops.data(), Ops.size());
   }
 
   // Extract_vec (Build_vector) generated by custom lowering





More information about the llvm-commits mailing list