mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 20:36:06 +00:00
Remove ASTOwningVector, it doesn't own anything and provides no value over SmallVector.
llvm-svn: 162492
This commit is contained in:
parent
91bbf41914
commit
f062343889
@ -1411,8 +1411,16 @@ private:
|
||||
//===--------------------------------------------------------------------===//
|
||||
// C99 6.8: Statements and Blocks.
|
||||
|
||||
/// A SmallVector of statements, with stack size 32 (as that is the only one
|
||||
/// used.)
|
||||
typedef SmallVector<Stmt*, 32> StmtVector;
|
||||
/// A SmallVector of expressions, with stack size 12 (the maximum used.)
|
||||
typedef SmallVector<Expr*, 12> ExprVector;
|
||||
/// A SmallVector of types.
|
||||
typedef SmallVector<ParsedType, 12> TypeVector;
|
||||
|
||||
StmtResult ParseStatement(SourceLocation *TrailingElseLoc = 0) {
|
||||
StmtVector Stmts(Actions);
|
||||
StmtVector Stmts;
|
||||
return ParseStatementOrDeclaration(Stmts, true, TrailingElseLoc);
|
||||
}
|
||||
StmtResult ParseStatementOrDeclaration(StmtVector &Stmts,
|
||||
|
@ -239,36 +239,11 @@ namespace clang {
|
||||
const PtrTy &operator[](unsigned Arg) const { return Nodes[Arg]; }
|
||||
};
|
||||
|
||||
/// \brief A small vector that owns a set of AST nodes.
|
||||
template <class PtrTy, unsigned N = 8>
|
||||
class ASTOwningVector : public SmallVector<PtrTy, N> {
|
||||
ASTOwningVector(ASTOwningVector &); // do not implement
|
||||
ASTOwningVector &operator=(ASTOwningVector &); // do not implement
|
||||
|
||||
public:
|
||||
explicit ASTOwningVector(Sema &Actions)
|
||||
{ }
|
||||
|
||||
PtrTy *take() {
|
||||
return &this->front();
|
||||
}
|
||||
|
||||
template<typename T> T **takeAs() { return reinterpret_cast<T**>(take()); }
|
||||
};
|
||||
|
||||
/// An opaque type for threading parsed type information through the
|
||||
/// parser.
|
||||
typedef OpaquePtr<QualType> ParsedType;
|
||||
typedef UnionOpaquePtr<QualType> UnionParsedType;
|
||||
|
||||
/// A SmallVector of statements, with stack size 32 (as that is the only one
|
||||
/// used.)
|
||||
typedef ASTOwningVector<Stmt*, 32> StmtVector;
|
||||
/// A SmallVector of expressions, with stack size 12 (the maximum used.)
|
||||
typedef ASTOwningVector<Expr*, 12> ExprVector;
|
||||
/// A SmallVector of types.
|
||||
typedef ASTOwningVector<ParsedType, 12> TypeVector;
|
||||
|
||||
// We can re-use the low bit of expression, statement, base, and
|
||||
// member-initializer pointers for the "invalid" flag of
|
||||
// ActionResult.
|
||||
|
@ -3554,7 +3554,7 @@ public:
|
||||
bool CompleteConstructorCall(CXXConstructorDecl *Constructor,
|
||||
MultiExprArg ArgsPtr,
|
||||
SourceLocation Loc,
|
||||
ASTOwningVector<Expr*> &ConvertedArgs,
|
||||
SmallVectorImpl<Expr*> &ConvertedArgs,
|
||||
bool AllowExplicit = false);
|
||||
|
||||
ParsedType getDestructorName(SourceLocation TildeLoc,
|
||||
|
@ -236,7 +236,7 @@ void Parser::ParseGNUAttributeArgs(IdentifierInfo *AttrName,
|
||||
break;
|
||||
}
|
||||
|
||||
ExprVector ArgExprs(Actions);
|
||||
ExprVector ArgExprs;
|
||||
|
||||
if (!BuiltinType &&
|
||||
(ParmLoc.isValid() ? Tok.is(tok::comma) : Tok.isNot(tok::r_paren))) {
|
||||
@ -279,7 +279,7 @@ void Parser::ParseGNUAttributeArgs(IdentifierInfo *AttrName,
|
||||
if (!ExpectAndConsume(tok::r_paren, diag::err_expected_rparen)) {
|
||||
AttributeList *attr =
|
||||
Attrs.addNew(AttrName, SourceRange(AttrNameLoc, RParen), 0, AttrNameLoc,
|
||||
ParmName, ParmLoc, ArgExprs.take(), ArgExprs.size(),
|
||||
ParmName, ParmLoc, ArgExprs.data(), ArgExprs.size(),
|
||||
AttributeList::AS_GNU);
|
||||
if (BuiltinType && attr->getKind() == AttributeList::AT_IBOutletCollection)
|
||||
Diag(Tok, diag::err_iboutletcollection_builtintype);
|
||||
@ -1003,7 +1003,7 @@ void Parser::ParseThreadSafetyAttribute(IdentifierInfo &AttrName,
|
||||
BalancedDelimiterTracker T(*this, tok::l_paren);
|
||||
T.consumeOpen();
|
||||
|
||||
ExprVector ArgExprs(Actions);
|
||||
ExprVector ArgExprs;
|
||||
bool ArgExprsOk = true;
|
||||
|
||||
// now parse the list of expressions
|
||||
@ -1023,7 +1023,7 @@ void Parser::ParseThreadSafetyAttribute(IdentifierInfo &AttrName,
|
||||
// Match the ')'.
|
||||
if (ArgExprsOk && !T.consumeClose()) {
|
||||
Attrs.addNew(&AttrName, AttrNameLoc, 0, AttrNameLoc, 0, SourceLocation(),
|
||||
ArgExprs.take(), ArgExprs.size(), AttributeList::AS_GNU);
|
||||
ArgExprs.data(), ArgExprs.size(), AttributeList::AS_GNU);
|
||||
}
|
||||
if (EndLoc)
|
||||
*EndLoc = T.getCloseLocation();
|
||||
@ -1665,7 +1665,7 @@ Decl *Parser::ParseDeclarationAfterDeclaratorAndAttributes(Declarator &D,
|
||||
BalancedDelimiterTracker T(*this, tok::l_paren);
|
||||
T.consumeOpen();
|
||||
|
||||
ExprVector Exprs(Actions);
|
||||
ExprVector Exprs;
|
||||
CommaLocsTy CommaLocs;
|
||||
|
||||
if (getLangOpts().CPlusPlus && D.getCXXScopeSpec().isSet()) {
|
||||
@ -2074,13 +2074,13 @@ void Parser::ParseAlignmentSpecifier(ParsedAttributes &Attrs,
|
||||
return;
|
||||
}
|
||||
|
||||
ExprVector ArgExprs(Actions);
|
||||
ExprVector ArgExprs;
|
||||
ArgExprs.push_back(ArgExpr.release());
|
||||
// FIXME: This should not be GNU, but we since the attribute used is
|
||||
// based on the spelling, and there is no true spelling for
|
||||
// C++11 attributes, this isn't accepted.
|
||||
Attrs.addNew(PP.getIdentifierInfo("aligned"), KWLoc, 0, KWLoc,
|
||||
0, T.getOpenLocation(), ArgExprs.take(), 1,
|
||||
0, T.getOpenLocation(), ArgExprs.data(), 1,
|
||||
AttributeList::AS_GNU);
|
||||
}
|
||||
|
||||
|
@ -2571,7 +2571,7 @@ Parser::MemInitResult Parser::ParseMemInitializer(Decl *ConstructorDecl) {
|
||||
T.consumeOpen();
|
||||
|
||||
// Parse the optional expression-list.
|
||||
ExprVector ArgExprs(Actions);
|
||||
ExprVector ArgExprs;
|
||||
CommaLocsTy CommaLocs;
|
||||
if (Tok.isNot(tok::r_paren) && ParseExpressionList(ArgExprs, CommaLocs)) {
|
||||
SkipUntil(tok::r_paren);
|
||||
@ -2586,7 +2586,7 @@ Parser::MemInitResult Parser::ParseMemInitializer(Decl *ConstructorDecl) {
|
||||
|
||||
return Actions.ActOnMemInitializer(ConstructorDecl, getCurScope(), SS, II,
|
||||
TemplateTypeTy, DS, IdLoc,
|
||||
T.getOpenLocation(), ArgExprs.take(),
|
||||
T.getOpenLocation(), ArgExprs.data(),
|
||||
ArgExprs.size(), T.getCloseLocation(),
|
||||
EllipsisLoc);
|
||||
}
|
||||
|
@ -1341,7 +1341,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
|
||||
BalancedDelimiterTracker PT(*this, tok::l_paren);
|
||||
|
||||
if (OpKind == tok::lesslessless) {
|
||||
ExprVector ExecConfigExprs(Actions);
|
||||
ExprVector ExecConfigExprs;
|
||||
CommaLocsTy ExecConfigCommaLocs;
|
||||
SourceLocation OpenLoc = ConsumeToken();
|
||||
|
||||
@ -1384,7 +1384,7 @@ Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {
|
||||
Loc = PT.getOpenLocation();
|
||||
}
|
||||
|
||||
ExprVector ArgExprs(Actions);
|
||||
ExprVector ArgExprs;
|
||||
CommaLocsTy CommaLocs;
|
||||
|
||||
if (Tok.is(tok::code_completion)) {
|
||||
@ -2093,7 +2093,7 @@ Parser::ParseParenExpression(ParenParseOption &ExprType, bool stopIfCastExpr,
|
||||
// Parse the expression-list.
|
||||
InMessageExpressionRAIIObject InMessage(*this, false);
|
||||
|
||||
ExprVector ArgExprs(Actions);
|
||||
ExprVector ArgExprs;
|
||||
CommaLocsTy CommaLocs;
|
||||
|
||||
if (!ParseExpressionList(ArgExprs, CommaLocs)) {
|
||||
@ -2211,8 +2211,8 @@ ExprResult Parser::ParseGenericSelectionExpression() {
|
||||
}
|
||||
|
||||
SourceLocation DefaultLoc;
|
||||
TypeVector Types(Actions);
|
||||
ExprVector Exprs(Actions);
|
||||
TypeVector Types;
|
||||
ExprVector Exprs;
|
||||
while (1) {
|
||||
ParsedType Ty;
|
||||
if (Tok.is(tok::kw_default)) {
|
||||
|
@ -1251,7 +1251,7 @@ Parser::ParseCXXTypeConstructExpression(const DeclSpec &DS) {
|
||||
BalancedDelimiterTracker T(*this, tok::l_paren);
|
||||
T.consumeOpen();
|
||||
|
||||
ExprVector Exprs(Actions);
|
||||
ExprVector Exprs;
|
||||
CommaLocsTy CommaLocs;
|
||||
|
||||
if (Tok.isNot(tok::r_paren)) {
|
||||
@ -2215,7 +2215,7 @@ Parser::ParseCXXNewExpression(bool UseGlobal, SourceLocation Start) {
|
||||
// A '(' now can be a new-placement or the '(' wrapping the type-id in the
|
||||
// second form of new-expression. It can't be a new-type-id.
|
||||
|
||||
ExprVector PlacementArgs(Actions);
|
||||
ExprVector PlacementArgs;
|
||||
SourceLocation PlacementLParen, PlacementRParen;
|
||||
|
||||
SourceRange TypeIdParens;
|
||||
@ -2285,7 +2285,7 @@ Parser::ParseCXXNewExpression(bool UseGlobal, SourceLocation Start) {
|
||||
|
||||
if (Tok.is(tok::l_paren)) {
|
||||
SourceLocation ConstructorLParen, ConstructorRParen;
|
||||
ExprVector ConstructorArgs(Actions);
|
||||
ExprVector ConstructorArgs;
|
||||
BalancedDelimiterTracker T(*this, tok::l_paren);
|
||||
T.consumeOpen();
|
||||
ConstructorLParen = T.getOpenLocation();
|
||||
|
@ -405,7 +405,7 @@ ExprResult Parser::ParseBraceInitializer() {
|
||||
|
||||
/// InitExprs - This is the actual list of expressions contained in the
|
||||
/// initializer.
|
||||
ExprVector InitExprs(Actions);
|
||||
ExprVector InitExprs;
|
||||
|
||||
if (Tok.is(tok::r_brace)) {
|
||||
// Empty initializers are a C++ feature and a GNU extension to C.
|
||||
|
@ -1806,7 +1806,7 @@ StmtResult Parser::ParseObjCTryStmt(SourceLocation atLoc) {
|
||||
Diag(Tok, diag::err_expected_lbrace);
|
||||
return StmtError();
|
||||
}
|
||||
StmtVector CatchStmts(Actions);
|
||||
StmtVector CatchStmts;
|
||||
StmtResult FinallyStmt;
|
||||
ParseScope TryScope(this, Scope::DeclScope);
|
||||
StmtResult TryBody(ParseCompoundStatementBody());
|
||||
@ -2418,7 +2418,7 @@ Parser::ParseObjCMessageExpressionBody(SourceLocation LBracLoc,
|
||||
|
||||
SmallVector<IdentifierInfo *, 12> KeyIdents;
|
||||
SmallVector<SourceLocation, 12> KeyLocs;
|
||||
ExprVector KeyExprs(Actions);
|
||||
ExprVector KeyExprs;
|
||||
|
||||
if (Tok.is(tok::colon)) {
|
||||
while (1) {
|
||||
@ -2551,21 +2551,12 @@ Parser::ParseObjCMessageExpressionBody(SourceLocation LBracLoc,
|
||||
|
||||
if (SuperLoc.isValid())
|
||||
return Actions.ActOnSuperMessage(getCurScope(), SuperLoc, Sel,
|
||||
LBracLoc, KeyLocs, RBracLoc,
|
||||
MultiExprArg(Actions,
|
||||
KeyExprs.take(),
|
||||
KeyExprs.size()));
|
||||
LBracLoc, KeyLocs, RBracLoc, KeyExprs);
|
||||
else if (ReceiverType)
|
||||
return Actions.ActOnClassMessage(getCurScope(), ReceiverType, Sel,
|
||||
LBracLoc, KeyLocs, RBracLoc,
|
||||
MultiExprArg(Actions,
|
||||
KeyExprs.take(),
|
||||
KeyExprs.size()));
|
||||
LBracLoc, KeyLocs, RBracLoc, KeyExprs);
|
||||
return Actions.ActOnInstanceMessage(getCurScope(), ReceiverExpr, Sel,
|
||||
LBracLoc, KeyLocs, RBracLoc,
|
||||
MultiExprArg(Actions,
|
||||
KeyExprs.take(),
|
||||
KeyExprs.size()));
|
||||
LBracLoc, KeyLocs, RBracLoc, KeyExprs);
|
||||
}
|
||||
|
||||
ExprResult Parser::ParseObjCStringLiteral(SourceLocation AtLoc) {
|
||||
@ -2576,7 +2567,7 @@ ExprResult Parser::ParseObjCStringLiteral(SourceLocation AtLoc) {
|
||||
// expressions. At this point, we know that the only valid thing that starts
|
||||
// with '@' is an @"".
|
||||
SmallVector<SourceLocation, 4> AtLocs;
|
||||
ExprVector AtStrings(Actions);
|
||||
ExprVector AtStrings;
|
||||
AtLocs.push_back(AtLoc);
|
||||
AtStrings.push_back(Res.release());
|
||||
|
||||
@ -2594,7 +2585,7 @@ ExprResult Parser::ParseObjCStringLiteral(SourceLocation AtLoc) {
|
||||
AtStrings.push_back(Lit.release());
|
||||
}
|
||||
|
||||
return Owned(Actions.ParseObjCStringLiteral(&AtLocs[0], AtStrings.take(),
|
||||
return Owned(Actions.ParseObjCStringLiteral(&AtLocs[0], AtStrings.data(),
|
||||
AtStrings.size()));
|
||||
}
|
||||
|
||||
@ -2661,7 +2652,7 @@ Parser::ParseObjCBoxedExpr(SourceLocation AtLoc) {
|
||||
}
|
||||
|
||||
ExprResult Parser::ParseObjCArrayLiteral(SourceLocation AtLoc) {
|
||||
ExprVector ElementExprs(Actions); // array elements.
|
||||
ExprVector ElementExprs; // array elements.
|
||||
ConsumeBracket(); // consume the l_square.
|
||||
|
||||
while (Tok.isNot(tok::r_square)) {
|
||||
@ -2689,7 +2680,7 @@ ExprResult Parser::ParseObjCArrayLiteral(SourceLocation AtLoc) {
|
||||
return ExprError(Diag(Tok, diag::err_expected_rsquare_or_comma));
|
||||
}
|
||||
SourceLocation EndLoc = ConsumeBracket(); // location of ']'
|
||||
MultiExprArg Args(Actions, ElementExprs.take(), ElementExprs.size());
|
||||
MultiExprArg Args(ElementExprs);
|
||||
return Owned(Actions.BuildObjCArrayLiteral(SourceRange(AtLoc, EndLoc), Args));
|
||||
}
|
||||
|
||||
|
@ -686,7 +686,7 @@ StmtResult Parser::ParseCompoundStatementBody(bool isStmtExpr) {
|
||||
|
||||
Sema::CompoundScopeRAII CompoundScope(Actions);
|
||||
|
||||
StmtVector Stmts(Actions);
|
||||
StmtVector Stmts;
|
||||
|
||||
// "__label__ X, Y, Z;" is the GNU "Local Label" extension. These are
|
||||
// only allowed at the start of a compound stmt regardless of the language.
|
||||
@ -1318,7 +1318,7 @@ StmtResult Parser::ParseForStatement(SourceLocation *TrailingElseLoc) {
|
||||
ColonProtectionRAIIObject ColonProtection(*this, MightBeForRangeStmt);
|
||||
|
||||
SourceLocation DeclStart = Tok.getLocation(), DeclEnd;
|
||||
StmtVector Stmts(Actions);
|
||||
StmtVector Stmts;
|
||||
DeclGroupPtrTy DG = ParseSimpleDeclaration(Stmts, Declarator::ForContext,
|
||||
DeclEnd, attrs, false,
|
||||
MightBeForRangeStmt ?
|
||||
@ -1749,9 +1749,9 @@ StmtResult Parser::ParseAsmStatement(bool &msAsm) {
|
||||
}
|
||||
|
||||
SmallVector<IdentifierInfo *, 4> Names;
|
||||
ExprVector Constraints(Actions);
|
||||
ExprVector Exprs(Actions);
|
||||
ExprVector Clobbers(Actions);
|
||||
ExprVector Constraints;
|
||||
ExprVector Exprs;
|
||||
ExprVector Clobbers;
|
||||
|
||||
if (Tok.is(tok::r_paren)) {
|
||||
// We have a simple asm expression like 'asm("foo")'.
|
||||
@ -2043,7 +2043,7 @@ StmtResult Parser::ParseCXXTryBlockCommon(SourceLocation TryLoc) {
|
||||
Handler.take());
|
||||
}
|
||||
else {
|
||||
StmtVector Handlers(Actions);
|
||||
StmtVector Handlers;
|
||||
ParsedAttributesWithRange attrs(AttrFactory);
|
||||
MaybeParseCXX0XAttributes(attrs);
|
||||
ProhibitAttributes(attrs);
|
||||
|
@ -693,7 +693,7 @@ Parser::ParseExternalDeclaration(ParsedAttributesWithRange &attrs,
|
||||
// A function definition cannot start with any of these keywords.
|
||||
{
|
||||
SourceLocation DeclEnd;
|
||||
StmtVector Stmts(Actions);
|
||||
StmtVector Stmts;
|
||||
return ParseDeclaration(Stmts, Declarator::FileContext, DeclEnd, attrs);
|
||||
}
|
||||
|
||||
@ -704,7 +704,7 @@ Parser::ParseExternalDeclaration(ParsedAttributesWithRange &attrs,
|
||||
Diag(ConsumeToken(), diag::warn_static_inline_explicit_inst_ignored)
|
||||
<< 0;
|
||||
SourceLocation DeclEnd;
|
||||
StmtVector Stmts(Actions);
|
||||
StmtVector Stmts;
|
||||
return ParseDeclaration(Stmts, Declarator::FileContext, DeclEnd, attrs);
|
||||
}
|
||||
goto dont_know;
|
||||
@ -716,7 +716,7 @@ Parser::ParseExternalDeclaration(ParsedAttributesWithRange &attrs,
|
||||
// Inline namespaces. Allowed as an extension even in C++03.
|
||||
if (NextKind == tok::kw_namespace) {
|
||||
SourceLocation DeclEnd;
|
||||
StmtVector Stmts(Actions);
|
||||
StmtVector Stmts;
|
||||
return ParseDeclaration(Stmts, Declarator::FileContext, DeclEnd, attrs);
|
||||
}
|
||||
|
||||
@ -726,7 +726,7 @@ Parser::ParseExternalDeclaration(ParsedAttributesWithRange &attrs,
|
||||
Diag(ConsumeToken(), diag::warn_static_inline_explicit_inst_ignored)
|
||||
<< 1;
|
||||
SourceLocation DeclEnd;
|
||||
StmtVector Stmts(Actions);
|
||||
StmtVector Stmts;
|
||||
return ParseDeclaration(Stmts, Declarator::FileContext, DeclEnd, attrs);
|
||||
}
|
||||
}
|
||||
|
@ -7669,7 +7669,7 @@ void Sema::DefineImplicitCopyAssignment(SourceLocation CurrentLocation,
|
||||
// which they were declared in the class definition.
|
||||
|
||||
// The statements that form the synthesized function body.
|
||||
ASTOwningVector<Stmt*> Statements(*this);
|
||||
SmallVector<Stmt*, 8> Statements;
|
||||
|
||||
// The parameter for the "other" object, which we are copying from.
|
||||
ParmVarDecl *Other = CopyAssignOperator->getParamDecl(0);
|
||||
@ -7874,7 +7874,7 @@ void Sema::DefineImplicitCopyAssignment(SourceLocation CurrentLocation,
|
||||
assert(BuiltinMemCpyRef && "Builtin reference cannot fail");
|
||||
}
|
||||
|
||||
ASTOwningVector<Expr*> CallArgs(*this);
|
||||
SmallVector<Expr*, 8> CallArgs;
|
||||
CallArgs.push_back(To.takeAs<Expr>());
|
||||
CallArgs.push_back(From.takeAs<Expr>());
|
||||
CallArgs.push_back(IntegerLiteral::Create(Context, Size, SizeType, Loc));
|
||||
@ -8210,7 +8210,7 @@ void Sema::DefineImplicitMoveAssignment(SourceLocation CurrentLocation,
|
||||
// definition.
|
||||
|
||||
// The statements that form the synthesized function body.
|
||||
ASTOwningVector<Stmt*> Statements(*this);
|
||||
SmallVector<Stmt*, 8> Statements;
|
||||
|
||||
// The parameter for the "other" object, which we are move from.
|
||||
ParmVarDecl *Other = MoveAssignOperator->getParamDecl(0);
|
||||
@ -8423,7 +8423,7 @@ void Sema::DefineImplicitMoveAssignment(SourceLocation CurrentLocation,
|
||||
assert(BuiltinMemCpyRef && "Builtin reference cannot fail");
|
||||
}
|
||||
|
||||
ASTOwningVector<Expr*> CallArgs(*this);
|
||||
SmallVector<Expr*, 8> CallArgs;
|
||||
CallArgs.push_back(To.takeAs<Expr>());
|
||||
CallArgs.push_back(From.takeAs<Expr>());
|
||||
CallArgs.push_back(IntegerLiteral::Create(Context, Size, SizeType, Loc));
|
||||
@ -9138,7 +9138,7 @@ bool
|
||||
Sema::CompleteConstructorCall(CXXConstructorDecl *Constructor,
|
||||
MultiExprArg ArgsPtr,
|
||||
SourceLocation Loc,
|
||||
ASTOwningVector<Expr*> &ConvertedArgs,
|
||||
SmallVectorImpl<Expr*> &ConvertedArgs,
|
||||
bool AllowExplicit) {
|
||||
// FIXME: This duplicates a lot of code from Sema::ConvertArgumentsForCall.
|
||||
unsigned NumArgs = ArgsPtr.size();
|
||||
|
@ -2349,7 +2349,7 @@ static ExprResult BuildCXXCastArgument(Sema &S,
|
||||
default: llvm_unreachable("Unhandled cast kind!");
|
||||
case CK_ConstructorConversion: {
|
||||
CXXConstructorDecl *Constructor = cast<CXXConstructorDecl>(Method);
|
||||
ASTOwningVector<Expr*> ConstructorArgs(S);
|
||||
SmallVector<Expr*, 8> ConstructorArgs;
|
||||
|
||||
if (S.CompleteConstructorCall(Constructor,
|
||||
MultiExprArg(&From, 1),
|
||||
@ -2506,7 +2506,7 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType,
|
||||
// FIXME: When can ToType be a reference type?
|
||||
assert(!ToType->isReferenceType());
|
||||
if (SCS.Second == ICK_Derived_To_Base) {
|
||||
ASTOwningVector<Expr*> ConstructorArgs(*this);
|
||||
SmallVector<Expr*, 8> ConstructorArgs;
|
||||
if (CompleteConstructorCall(cast<CXXConstructorDecl>(SCS.CopyConstructor),
|
||||
MultiExprArg(*this, &From, 1),
|
||||
/*FIXME:ConstructLoc*/SourceLocation(),
|
||||
|
@ -4478,7 +4478,7 @@ static ExprResult CopyObject(Sema &S,
|
||||
}
|
||||
|
||||
CXXConstructorDecl *Constructor = cast<CXXConstructorDecl>(Best->Function);
|
||||
ASTOwningVector<Expr*> ConstructorArgs(S);
|
||||
SmallVector<Expr*, 8> ConstructorArgs;
|
||||
CurInit.release(); // Ownership transferred into MultiExprArg, below.
|
||||
|
||||
S.CheckConstructorAccess(Loc, Constructor, Entity,
|
||||
@ -4619,7 +4619,7 @@ PerformConstructorInitialization(Sema &S,
|
||||
bool HadMultipleCandidates = Step.Function.HadMultipleCandidates;
|
||||
|
||||
// Build a call to the selected constructor.
|
||||
ASTOwningVector<Expr*> ConstructorArgs(S);
|
||||
SmallVector<Expr*, 8> ConstructorArgs;
|
||||
SourceLocation Loc = (Kind.isCopyInit() && Kind.getEqualLoc().isValid())
|
||||
? Kind.getEqualLoc()
|
||||
: Kind.getLocation();
|
||||
@ -4661,7 +4661,7 @@ PerformConstructorInitialization(Sema &S,
|
||||
Kind.getKind() == InitializationKind::IK_Value)))) {
|
||||
// An explicitly-constructed temporary, e.g., X(1, 2).
|
||||
unsigned NumExprs = ConstructorArgs.size();
|
||||
Expr **Exprs = (Expr **)ConstructorArgs.take();
|
||||
Expr **Exprs = ConstructorArgs.data();
|
||||
S.MarkFunctionReferenced(Loc, Constructor);
|
||||
S.DiagnoseUseOfDecl(Constructor, Loc);
|
||||
|
||||
@ -5031,7 +5031,7 @@ InitializationSequence::Perform(Sema &S,
|
||||
bool CreatedObject = false;
|
||||
if (CXXConstructorDecl *Constructor = dyn_cast<CXXConstructorDecl>(Fn)) {
|
||||
// Build a call to the selected constructor.
|
||||
ASTOwningVector<Expr*> ConstructorArgs(S);
|
||||
SmallVector<Expr*, 8> ConstructorArgs;
|
||||
SourceLocation Loc = CurInit.get()->getLocStart();
|
||||
CurInit.release(); // Ownership transferred into MultiExprArg, below.
|
||||
|
||||
|
@ -3031,7 +3031,7 @@ ExprResult Sema::SubstInitializer(Expr *Init,
|
||||
isa<CXXTemporaryObjectExpr>(Construct))
|
||||
return SubstExpr(Init, TemplateArgs);
|
||||
|
||||
ASTOwningVector<Expr*> NewArgs(*this);
|
||||
SmallVector<Expr*, 8> NewArgs;
|
||||
if (SubstExprs(Construct->getArgs(), Construct->getNumArgs(), true,
|
||||
TemplateArgs, NewArgs))
|
||||
return ExprError();
|
||||
|
@ -2118,7 +2118,7 @@ public:
|
||||
bool RequiresZeroInit,
|
||||
CXXConstructExpr::ConstructionKind ConstructKind,
|
||||
SourceRange ParenRange) {
|
||||
ASTOwningVector<Expr*> ConvertedArgs(SemaRef);
|
||||
SmallVector<Expr*, 8> ConvertedArgs;
|
||||
if (getSema().CompleteConstructorCall(Constructor, Args, Loc,
|
||||
ConvertedArgs))
|
||||
return ExprError();
|
||||
@ -5097,7 +5097,7 @@ TreeTransform<Derived>::TransformCompoundStmt(CompoundStmt *S,
|
||||
|
||||
bool SubStmtInvalid = false;
|
||||
bool SubStmtChanged = false;
|
||||
ASTOwningVector<Stmt*> Statements(getSema());
|
||||
SmallVector<Stmt*, 8> Statements;
|
||||
for (CompoundStmt::body_iterator B = S->body_begin(), BEnd = S->body_end();
|
||||
B != BEnd; ++B) {
|
||||
StmtResult Result = getDerived().TransformStmt(*B);
|
||||
@ -5533,12 +5533,12 @@ template<typename Derived>
|
||||
StmtResult
|
||||
TreeTransform<Derived>::TransformAsmStmt(AsmStmt *S) {
|
||||
|
||||
ASTOwningVector<Expr*> Constraints(getSema());
|
||||
ASTOwningVector<Expr*> Exprs(getSema());
|
||||
SmallVector<Expr*, 8> Constraints;
|
||||
SmallVector<Expr*, 8> Exprs;
|
||||
SmallVector<IdentifierInfo *, 4> Names;
|
||||
|
||||
ExprResult AsmString;
|
||||
ASTOwningVector<Expr*> Clobbers(getSema());
|
||||
SmallVector<Expr*, 8> Clobbers;
|
||||
|
||||
bool ExprsChanged = false;
|
||||
|
||||
@ -5621,7 +5621,7 @@ TreeTransform<Derived>::TransformObjCAtTryStmt(ObjCAtTryStmt *S) {
|
||||
|
||||
// Transform the @catch statements (if present).
|
||||
bool AnyCatchChanged = false;
|
||||
ASTOwningVector<Stmt*> CatchStmts(SemaRef);
|
||||
SmallVector<Stmt*, 8> CatchStmts;
|
||||
for (unsigned I = 0, N = S->getNumCatchStmts(); I != N; ++I) {
|
||||
StmtResult Catch = getDerived().TransformStmt(S->getCatchStmt(I));
|
||||
if (Catch.isInvalid())
|
||||
@ -5852,7 +5852,7 @@ TreeTransform<Derived>::TransformCXXTryStmt(CXXTryStmt *S) {
|
||||
|
||||
// Transform the handlers.
|
||||
bool HandlerChanged = false;
|
||||
ASTOwningVector<Stmt*> Handlers(SemaRef);
|
||||
SmallVector<Stmt*, 8> Handlers;
|
||||
for (unsigned I = 0, N = S->getNumHandlers(); I != N; ++I) {
|
||||
StmtResult Handler
|
||||
= getDerived().TransformCXXCatchStmt(S->getHandler(I));
|
||||
@ -6383,7 +6383,7 @@ TreeTransform<Derived>::TransformCallExpr(CallExpr *E) {
|
||||
|
||||
// Transform arguments.
|
||||
bool ArgChanged = false;
|
||||
ASTOwningVector<Expr*> Args(SemaRef);
|
||||
SmallVector<Expr*, 8> Args;
|
||||
if (getDerived().TransformExprs(E->getArgs(), E->getNumArgs(), true, Args,
|
||||
&ArgChanged))
|
||||
return ExprError();
|
||||
@ -6642,7 +6642,7 @@ ExprResult
|
||||
TreeTransform<Derived>::TransformInitListExpr(InitListExpr *E) {
|
||||
bool InitChanged = false;
|
||||
|
||||
ASTOwningVector<Expr*, 4> Inits(SemaRef);
|
||||
SmallVector<Expr*, 4> Inits;
|
||||
if (getDerived().TransformExprs(E->getInits(), E->getNumInits(), false,
|
||||
Inits, &InitChanged))
|
||||
return ExprError();
|
||||
@ -6665,7 +6665,7 @@ TreeTransform<Derived>::TransformDesignatedInitExpr(DesignatedInitExpr *E) {
|
||||
return ExprError();
|
||||
|
||||
// transform the designators.
|
||||
ASTOwningVector<Expr*, 4> ArrayExprs(SemaRef);
|
||||
SmallVector<Expr*, 4> ArrayExprs;
|
||||
bool ExprChanged = false;
|
||||
for (DesignatedInitExpr::designators_iterator D = E->designators_begin(),
|
||||
DEnd = E->designators_end();
|
||||
@ -6765,7 +6765,7 @@ template<typename Derived>
|
||||
ExprResult
|
||||
TreeTransform<Derived>::TransformParenListExpr(ParenListExpr *E) {
|
||||
bool ArgumentChanged = false;
|
||||
ASTOwningVector<Expr*, 4> Inits(SemaRef);
|
||||
SmallVector<Expr*, 4> Inits;
|
||||
if (TransformExprs(E->getExprs(), E->getNumExprs(), true, Inits,
|
||||
&ArgumentChanged))
|
||||
return ExprError();
|
||||
@ -6872,7 +6872,7 @@ TreeTransform<Derived>::TransformCXXOperatorCallExpr(CXXOperatorCallExpr *E) {
|
||||
static_cast<Expr *>(Object.get())->getLocEnd());
|
||||
|
||||
// Transform the call arguments.
|
||||
ASTOwningVector<Expr*> Args(SemaRef);
|
||||
SmallVector<Expr*, 8> Args;
|
||||
if (getDerived().TransformExprs(E->getArgs() + 1, E->getNumArgs() - 1, true,
|
||||
Args))
|
||||
return ExprError();
|
||||
@ -6947,7 +6947,7 @@ TreeTransform<Derived>::TransformCUDAKernelCallExpr(CUDAKernelCallExpr *E) {
|
||||
|
||||
// Transform arguments.
|
||||
bool ArgChanged = false;
|
||||
ASTOwningVector<Expr*> Args(SemaRef);
|
||||
SmallVector<Expr*, 8> Args;
|
||||
if (getDerived().TransformExprs(E->getArgs(), E->getNumArgs(), true, Args,
|
||||
&ArgChanged))
|
||||
return ExprError();
|
||||
@ -7219,7 +7219,7 @@ TreeTransform<Derived>::TransformCXXNewExpr(CXXNewExpr *E) {
|
||||
|
||||
// Transform the placement arguments (if any).
|
||||
bool ArgumentChanged = false;
|
||||
ASTOwningVector<Expr*> PlacementArgs(SemaRef);
|
||||
SmallVector<Expr*, 8> PlacementArgs;
|
||||
if (getDerived().TransformExprs(E->getPlacementArgs(),
|
||||
E->getNumPlacementArgs(), true,
|
||||
PlacementArgs, &ArgumentChanged))
|
||||
@ -7793,7 +7793,7 @@ TreeTransform<Derived>::TransformCXXConstructExpr(CXXConstructExpr *E) {
|
||||
return ExprError();
|
||||
|
||||
bool ArgumentChanged = false;
|
||||
ASTOwningVector<Expr*> Args(SemaRef);
|
||||
SmallVector<Expr*, 8> Args;
|
||||
if (getDerived().TransformExprs(E->getArgs(), E->getNumArgs(), true, Args,
|
||||
&ArgumentChanged))
|
||||
return ExprError();
|
||||
@ -7854,7 +7854,7 @@ TreeTransform<Derived>::TransformCXXTemporaryObjectExpr(
|
||||
return ExprError();
|
||||
|
||||
bool ArgumentChanged = false;
|
||||
ASTOwningVector<Expr*> Args(SemaRef);
|
||||
SmallVector<Expr*, 8> Args;
|
||||
Args.reserve(E->getNumArgs());
|
||||
if (TransformExprs(E->getArgs(), E->getNumArgs(), true, Args,
|
||||
&ArgumentChanged))
|
||||
@ -8035,7 +8035,7 @@ TreeTransform<Derived>::TransformCXXUnresolvedConstructExpr(
|
||||
return ExprError();
|
||||
|
||||
bool ArgumentChanged = false;
|
||||
ASTOwningVector<Expr*> Args(SemaRef);
|
||||
SmallVector<Expr*, 8> Args;
|
||||
Args.reserve(E->arg_size());
|
||||
if (getDerived().TransformExprs(E->arg_begin(), E->arg_size(), true, Args,
|
||||
&ArgumentChanged))
|
||||
@ -8573,7 +8573,7 @@ ExprResult
|
||||
TreeTransform<Derived>::TransformObjCMessageExpr(ObjCMessageExpr *E) {
|
||||
// Transform arguments.
|
||||
bool ArgChanged = false;
|
||||
ASTOwningVector<Expr*> Args(SemaRef);
|
||||
SmallVector<Expr*, 8> Args;
|
||||
Args.reserve(E->getNumArgs());
|
||||
if (getDerived().TransformExprs(E->getArgs(), E->getNumArgs(), false, Args,
|
||||
&ArgChanged))
|
||||
@ -8737,7 +8737,7 @@ template<typename Derived>
|
||||
ExprResult
|
||||
TreeTransform<Derived>::TransformShuffleVectorExpr(ShuffleVectorExpr *E) {
|
||||
bool ArgumentChanged = false;
|
||||
ASTOwningVector<Expr*> SubExprs(SemaRef);
|
||||
SmallVector<Expr*, 8> SubExprs;
|
||||
SubExprs.reserve(E->getNumSubExprs());
|
||||
if (getDerived().TransformExprs(E->getSubExprs(), E->getNumSubExprs(), false,
|
||||
SubExprs, &ArgumentChanged))
|
||||
@ -8851,7 +8851,7 @@ ExprResult
|
||||
TreeTransform<Derived>::TransformAtomicExpr(AtomicExpr *E) {
|
||||
QualType RetTy = getDerived().TransformType(E->getType());
|
||||
bool ArgumentChanged = false;
|
||||
ASTOwningVector<Expr*> SubExprs(SemaRef);
|
||||
SmallVector<Expr*, 8> SubExprs;
|
||||
SubExprs.reserve(E->getNumSubExprs());
|
||||
if (getDerived().TransformExprs(E->getSubExprs(), E->getNumSubExprs(), false,
|
||||
SubExprs, &ArgumentChanged))
|
||||
|
Loading…
x
Reference in New Issue
Block a user