From 267010864e139781ef5949939e081c41f954de0a Mon Sep 17 00:00:00 2001 From: Jay Foad Date: Wed, 22 Jun 2011 09:24:39 +0000 Subject: Replace the existing forms of ConstantArray::get() with a single form that takes an ArrayRef. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@133615 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 2 +- lib/CodeGen/ShadowStackGC.cpp | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'lib/CodeGen') diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 443fb3271d..e3d3906584 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -7470,7 +7470,7 @@ SDValue DAGCombiner::SimplifySelectCC(DebugLoc DL, SDValue N0, SDValue N1, const TargetData &TD = *TLI.getTargetData(); // Create a ConstantArray of the two constants. - Constant *CA = ConstantArray::get(ArrayType::get(FPTy, 2), Elts, 2); + Constant *CA = ConstantArray::get(ArrayType::get(FPTy, 2), Elts); SDValue CPIdx = DAG.getConstantPool(CA, TLI.getPointerTy(), TD.getPrefTypeAlignment(FPTy)); unsigned Alignment = cast(CPIdx)->getAlignment(); diff --git a/lib/CodeGen/ShadowStackGC.cpp b/lib/CodeGen/ShadowStackGC.cpp index 94dc3ed475..ff58b221cb 100644 --- a/lib/CodeGen/ShadowStackGC.cpp +++ b/lib/CodeGen/ShadowStackGC.cpp @@ -201,6 +201,7 @@ Constant *ShadowStackGC::GetFrameMap(Function &F) { NumMeta = I + 1; Metadata.push_back(ConstantExpr::getBitCast(C, VoidPtr)); } + Metadata.resize(NumMeta); const Type *Int32Ty = Type::getInt32Ty(F.getContext()); @@ -211,8 +212,7 @@ Constant *ShadowStackGC::GetFrameMap(Function &F) { Constant *DescriptorElts[] = { ConstantStruct::get(StructType::get(Int32Ty, Int32Ty, NULL), BaseElts), - ConstantArray::get(ArrayType::get(VoidPtr, NumMeta), - Metadata.begin(), NumMeta) + ConstantArray::get(ArrayType::get(VoidPtr, NumMeta), Metadata) }; Constant *FrameMap = -- cgit v1.2.3