Replace some constant-sized SmallVectors.

llvm-svn: 99884
This commit is contained in:
Benjamin Kramer 2010-03-30 11:36:44 +00:00
parent 8061bb141e
commit 9e649c3cfe
2 changed files with 11 additions and 14 deletions

View File

@ -714,10 +714,8 @@ llvm::DIType CGDebugInfo::getOrCreateVTablePtrType(llvm::DIFile Unit) {
ASTContext &Context = CGM.getContext(); ASTContext &Context = CGM.getContext();
/* Function type */ /* Function type */
llvm::SmallVector<llvm::DIDescriptor, 16> STys; llvm::DIDescriptor STy = getOrCreateType(Context.IntTy, Unit);
STys.push_back(getOrCreateType(Context.IntTy, Unit)); llvm::DIArray SElements = DebugFactory.GetOrCreateArray(&STy, 1);
llvm::DIArray SElements =
DebugFactory.GetOrCreateArray(STys.data(), STys.size());
llvm::DIType SubTy = llvm::DIType SubTy =
DebugFactory.CreateCompositeType(llvm::dwarf::DW_TAG_subroutine_type, DebugFactory.CreateCompositeType(llvm::dwarf::DW_TAG_subroutine_type,
Unit, "", Unit, Unit, "", Unit,
@ -1070,11 +1068,9 @@ llvm::DIType CGDebugInfo::CreateType(const VectorType *Ty,
uint64_t NumElems = Ty->getNumElements(); uint64_t NumElems = Ty->getNumElements();
if (NumElems > 0) if (NumElems > 0)
--NumElems; --NumElems;
llvm::SmallVector<llvm::DIDescriptor, 8> Subscripts;
Subscripts.push_back(DebugFactory.GetOrCreateSubrange(0, NumElems));
llvm::DIArray SubscriptArray = llvm::DIDescriptor Subscript = DebugFactory.GetOrCreateSubrange(0, NumElems);
DebugFactory.GetOrCreateArray(Subscripts.data(), Subscripts.size()); llvm::DIArray SubscriptArray = DebugFactory.GetOrCreateArray(&Subscript, 1);
uint64_t Size = CGM.getContext().getTypeSize(Ty); uint64_t Size = CGM.getContext().getTypeSize(Ty);
uint64_t Align = CGM.getContext().getTypeAlign(Ty); uint64_t Align = CGM.getContext().getTypeAlign(Ty);

View File

@ -464,12 +464,13 @@ void CodeGenFunction::EmitObjCForCollectionStmt(const ObjCForCollectionStmt &S){
static const unsigned NumItems = 16; static const unsigned NumItems = 16;
// Get selector // Get selector
llvm::SmallVector<IdentifierInfo*, 3> II; IdentifierInfo *II[] = {
II.push_back(&CGM.getContext().Idents.get("countByEnumeratingWithState")); &CGM.getContext().Idents.get("countByEnumeratingWithState"),
II.push_back(&CGM.getContext().Idents.get("objects")); &CGM.getContext().Idents.get("objects"),
II.push_back(&CGM.getContext().Idents.get("count")); &CGM.getContext().Idents.get("count")
Selector FastEnumSel = CGM.getContext().Selectors.getSelector(II.size(), };
&II[0]); Selector FastEnumSel =
CGM.getContext().Selectors.getSelector(llvm::array_lengthof(II), &II[0]);
QualType ItemsTy = QualType ItemsTy =
getContext().getConstantArrayType(getContext().getObjCIdType(), getContext().getConstantArrayType(getContext().getObjCIdType(),