From: Benjamin Kramer Date: Tue, 30 Mar 2010 11:36:44 +0000 (+0000) Subject: Replace some constant-sized SmallVectors. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ad4688669579d5d7b025137a095be66936d7ea31;p=clang Replace some constant-sized SmallVectors. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@99884 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/CGDebugInfo.cpp b/lib/CodeGen/CGDebugInfo.cpp index 0e789c92d6..426f155172 100644 --- a/lib/CodeGen/CGDebugInfo.cpp +++ b/lib/CodeGen/CGDebugInfo.cpp @@ -714,10 +714,8 @@ llvm::DIType CGDebugInfo::getOrCreateVTablePtrType(llvm::DIFile Unit) { ASTContext &Context = CGM.getContext(); /* Function type */ - llvm::SmallVector STys; - STys.push_back(getOrCreateType(Context.IntTy, Unit)); - llvm::DIArray SElements = - DebugFactory.GetOrCreateArray(STys.data(), STys.size()); + llvm::DIDescriptor STy = getOrCreateType(Context.IntTy, Unit); + llvm::DIArray SElements = DebugFactory.GetOrCreateArray(&STy, 1); llvm::DIType SubTy = DebugFactory.CreateCompositeType(llvm::dwarf::DW_TAG_subroutine_type, Unit, "", Unit, @@ -1070,11 +1068,9 @@ llvm::DIType CGDebugInfo::CreateType(const VectorType *Ty, uint64_t NumElems = Ty->getNumElements(); if (NumElems > 0) --NumElems; - llvm::SmallVector Subscripts; - Subscripts.push_back(DebugFactory.GetOrCreateSubrange(0, NumElems)); - llvm::DIArray SubscriptArray = - DebugFactory.GetOrCreateArray(Subscripts.data(), Subscripts.size()); + llvm::DIDescriptor Subscript = DebugFactory.GetOrCreateSubrange(0, NumElems); + llvm::DIArray SubscriptArray = DebugFactory.GetOrCreateArray(&Subscript, 1); uint64_t Size = CGM.getContext().getTypeSize(Ty); uint64_t Align = CGM.getContext().getTypeAlign(Ty); diff --git a/lib/CodeGen/CGObjC.cpp b/lib/CodeGen/CGObjC.cpp index f40b3d705d..d2b7a242e8 100644 --- a/lib/CodeGen/CGObjC.cpp +++ b/lib/CodeGen/CGObjC.cpp @@ -464,12 +464,13 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S){ static const unsigned NumItems = 16; // Get selector - llvm::SmallVector II; - II.push_back(&CGM.getContext().Idents.get("countByEnumeratingWithState")); - II.push_back(&CGM.getContext().Idents.get("objects")); - II.push_back(&CGM.getContext().Idents.get("count")); - Selector FastEnumSel = CGM.getContext().Selectors.getSelector(II.size(), - &II[0]); + IdentifierInfo *II[] = { + &CGM.getContext().Idents.get("countByEnumeratingWithState"), + &CGM.getContext().Idents.get("objects"), + &CGM.getContext().Idents.get("count") + }; + Selector FastEnumSel = + CGM.getContext().Selectors.getSelector(llvm::array_lengthof(II), &II[0]); QualType ItemsTy = getContext().getConstantArrayType(getContext().getObjCIdType(),