diff options
Diffstat (limited to 'include/clang')
-rw-r--r-- | include/clang/Parse/Parser.h | 10 | ||||
-rw-r--r-- | include/clang/Sema/Ownership.h | 25 | ||||
-rw-r--r-- | include/clang/Sema/Sema.h | 2 |
3 files changed, 10 insertions, 27 deletions
diff --git a/include/clang/Parse/Parser.h b/include/clang/Parse/Parser.h index 5e80ca36a0..f11b7fa9a7 100644 --- a/include/clang/Parse/Parser.h +++ b/include/clang/Parse/Parser.h @@ -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, diff --git a/include/clang/Sema/Ownership.h b/include/clang/Sema/Ownership.h index 84d55f4251..190ceb7133 100644 --- a/include/clang/Sema/Ownership.h +++ b/include/clang/Sema/Ownership.h @@ -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. diff --git a/include/clang/Sema/Sema.h b/include/clang/Sema/Sema.h index 996ce06a38..f4ca2f8634 100644 --- a/include/clang/Sema/Sema.h +++ b/include/clang/Sema/Sema.h @@ -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, |