From c5e0337eb221767e207f6b2894d5944285ef086a Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Fri, 24 Apr 2009 04:57:02 +0000 Subject: [PATCH] Move the CXXConstructExpr before the CXXTemporaryObjectExpr so that the temporary object expr can inherit from the construct expr. No functionality change. llvm-svn: 69953 --- clang/include/clang/AST/ExprCXX.h | 95 ++++++++++++++++--------------- 1 file changed, 48 insertions(+), 47 deletions(-) diff --git a/clang/include/clang/AST/ExprCXX.h b/clang/include/clang/AST/ExprCXX.h index 6ef7513e05cc..7daaa8abbc47 100644 --- a/clang/include/clang/AST/ExprCXX.h +++ b/clang/include/clang/AST/ExprCXX.h @@ -379,6 +379,54 @@ public: virtual child_iterator child_end(); }; + +/// CXXConstructExpr - Represents a call to a C++ constructor. +class CXXConstructExpr : public Expr { + VarDecl *VD; + CXXConstructorDecl *Constructor; + + bool Elidable; + + Stmt **Args; + unsigned NumArgs; + + CXXConstructExpr(ASTContext &C, VarDecl *vd, QualType T, + CXXConstructorDecl *d, bool elidable, + Expr **args, unsigned numargs); + ~CXXConstructExpr() { } + +public: + static CXXConstructExpr *Create(ASTContext &C, VarDecl *VD, QualType T, + CXXConstructorDecl *D, bool Elidable, + Expr **Args, unsigned NumArgs); + + void Destroy(ASTContext &C); + + const VarDecl* getVarDecl() const { return VD; } + const CXXConstructorDecl* getConstructor() const { return Constructor; } + + typedef ExprIterator arg_iterator; + typedef ConstExprIterator const_arg_iterator; + + arg_iterator arg_begin() { return Args; } + arg_iterator arg_end() { return Args + NumArgs; } + const_arg_iterator arg_begin() const { return Args; } + const_arg_iterator arg_end() const { return Args + NumArgs; } + + unsigned getNumArgs() const { return NumArgs; } + + virtual SourceRange getSourceRange() const { return SourceRange(); } + + static bool classof(const Stmt *T) { + return T->getStmtClass() == CXXConstructExprClass; + } + static bool classof(const CXXConstructExpr *) { return true; } + + // Iterators + virtual child_iterator child_begin(); + virtual child_iterator child_end(); +}; + /// CXXFunctionalCastExpr - Represents an explicit C++ type conversion /// that uses "functional" notion (C++ [expr.type.conv]). Example: @c /// x = int(0.5); @@ -890,53 +938,6 @@ public: virtual StmtIterator child_end(); }; -/// CXXConstructExpr - Represents a call to a C++ constructor. -class CXXConstructExpr : public Expr { - VarDecl *VD; - CXXConstructorDecl *Constructor; - - bool Elidable; - - Stmt **Args; - unsigned NumArgs; - - CXXConstructExpr(ASTContext &C, VarDecl *vd, QualType T, - CXXConstructorDecl *d, bool elidable, - Expr **args, unsigned numargs); - ~CXXConstructExpr() { } - -public: - static CXXConstructExpr *Create(ASTContext &C, VarDecl *VD, QualType T, - CXXConstructorDecl *D, bool Elidable, - Expr **Args, unsigned NumArgs); - - void Destroy(ASTContext &C); - - const VarDecl* getVarDecl() const { return VD; } - const CXXConstructorDecl* getConstructor() const { return Constructor; } - - typedef ExprIterator arg_iterator; - typedef ConstExprIterator const_arg_iterator; - - arg_iterator arg_begin() { return Args; } - arg_iterator arg_end() { return Args + NumArgs; } - const_arg_iterator arg_begin() const { return Args; } - const_arg_iterator arg_end() const { return Args + NumArgs; } - - unsigned getNumArgs() const { return NumArgs; } - - virtual SourceRange getSourceRange() const { return SourceRange(); } - - static bool classof(const Stmt *T) { - return T->getStmtClass() == CXXConstructExprClass; - } - static bool classof(const CXXConstructExpr *) { return true; } - - // Iterators - virtual child_iterator child_begin(); - virtual child_iterator child_end(); -}; - /// CXXDestroyExpr - Represents an implicit call to a C++ destructor. class CXXDestroyExpr : public Expr { VarDecl *VD;