More changes to std::vector usage.

Replace with std::vector with static array, llvm::SmallVector or
add code to reserve space.
This commit is contained in:
kai 2013-03-17 22:05:04 +01:00
parent bc09ceae18
commit 7d65a311b1
9 changed files with 70 additions and 76 deletions

View file

@ -216,16 +216,6 @@ static llvm::DIType dwarfCompositeType(Type* type)
LLType* T = DtoType(type);
Type* t = type->toBasetype();
// defaults
llvm::StringRef name;
unsigned linnum = 0;
llvm::DIFile file;
// elements
std::vector<llvm::Value*> elems;
llvm::DIType derivedFrom;
assert((t->ty == Tstruct || t->ty == Tclass) &&
"unsupported type for dwarfCompositeType");
AggregateDeclaration* sd;
@ -254,9 +244,15 @@ static llvm::DIType dwarfCompositeType(Type* type)
if (static_cast<llvm::MDNode*>(ir->diCompositeType) != 0)
return ir->diCompositeType;
name = sd->toChars();
linnum = sd->loc.linnum;
file = DtoDwarfFile(sd->loc);
// elements
std::vector<llvm::Value*> elems;
// defaults
llvm::StringRef name = sd->toChars();
unsigned linnum = sd->loc.linnum;
llvm::DIFile file = DtoDwarfFile(sd->loc);
llvm::DIType derivedFrom;
// set diCompositeType to handle recursive types properly
if (!ir->diCompositeType)
ir->diCompositeType = gIR->dibuilder.createTemporaryType();