Use a smaller vector than SmallVector.

Shrinks OverloadCandidate from 208 to 168 bytes.

llvm-svn: 148204
This commit is contained in:
Benjamin Kramer 2012-01-14 21:05:10 +00:00
parent 907018f0ad
commit 490afa6b9d
3 changed files with 5 additions and 7 deletions

View File

@ -39,7 +39,7 @@ struct ConversionFixItGenerator {
ExprValueKind FromVK);
/// The list of Hints generated so far.
SmallVector<FixItHint, 1> Hints;
std::vector<FixItHint> Hints;
/// The number of Conversions fixed. This can be different from the size
/// of the Hints vector since we allow multiple FixIts per conversion.

View File

@ -9212,9 +9212,8 @@ bool Sema::DiagnoseAssignmentResult(AssignConvertType ConvTy,
// If we can fix the conversion, suggest the FixIts.
assert(ConvHints.isNull() || Hint.isNull());
if (!ConvHints.isNull()) {
for (llvm::SmallVector<FixItHint, 1>::iterator
HI = ConvHints.Hints.begin(), HE = ConvHints.Hints.end();
HI != HE; ++HI)
for (std::vector<FixItHint>::iterator HI = ConvHints.Hints.begin(),
HE = ConvHints.Hints.end(); HI != HE; ++HI)
FDiag << *HI;
} else {
FDiag << Hint;

View File

@ -7477,9 +7477,8 @@ void DiagnoseBadConversion(Sema &S, OverloadCandidate *Cand, unsigned I) {
<< (unsigned) (Cand->Fix.Kind);
// If we can fix the conversion, suggest the FixIts.
for (SmallVector<FixItHint, 1>::iterator
HI = Cand->Fix.Hints.begin(), HE = Cand->Fix.Hints.end();
HI != HE; ++HI)
for (std::vector<FixItHint>::iterator HI = Cand->Fix.Hints.begin(),
HE = Cand->Fix.Hints.end(); HI != HE; ++HI)
FDiag << *HI;
S.Diag(Fn->getLocation(), FDiag);