From 2d44e8a41de8a33c0f04ac198714f71dc841bab0 Mon Sep 17 00:00:00 2001 From: Anders Carlsson Date: Fri, 1 May 2009 22:18:43 +0000 Subject: [PATCH] Rename CXXExprWithCleanup to CXXExprWithTemporaries. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@70584 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/clang/AST/ExprCXX.h | 35 ++++++--------------------------- include/clang/AST/StmtNodes.def | 2 +- lib/AST/ExprCXX.cpp | 15 +++++++------- lib/AST/StmtPrinter.cpp | 2 +- 4 files changed, 16 insertions(+), 38 deletions(-) diff --git a/include/clang/AST/ExprCXX.h b/include/clang/AST/ExprCXX.h index 568a9f2a45..483f0e31d6 100644 --- a/include/clang/AST/ExprCXX.h +++ b/include/clang/AST/ExprCXX.h @@ -923,39 +923,16 @@ public: virtual StmtIterator child_end(); }; -/// CXXDestroyExpr - Represents an implicit call to a C++ destructor. -class CXXDestroyExpr : public Expr { - VarDecl *VD; - - CXXDestroyExpr(VarDecl* vd, QualType T) - : Expr(CXXDestroyExprClass, T, false, vd->getType()->isDependentType()), - VD(vd) { } - -public: - static CXXDestroyExpr *Create(ASTContext &C, VarDecl *vd); - - virtual SourceRange getSourceRange() const { return SourceRange(); } - - // Implement isa/cast/dyncast/etc. - static bool classof(const Stmt *T) { - return T->getStmtClass() == CXXDestroyExprClass; - } - static bool classof(const CXXDestroyExpr *) { return true; } - - // Iterators - virtual child_iterator child_begin(); - virtual child_iterator child_end(); -}; - -class CXXExprWithCleanup : public Expr { +class CXXExprWithTemporaries : public Expr { Stmt *SubExpr; CXXTempVarDecl **Decls; unsigned NumDecls; public: - CXXExprWithCleanup(Expr *subexpr, CXXTempVarDecl **decls, unsigned numdecls); - ~CXXExprWithCleanup(); + CXXExprWithTemporaries(Expr *subexpr, CXXTempVarDecl **decls, + unsigned numdecls); + ~CXXExprWithTemporaries(); const Expr *getSubExpr() const { return cast(SubExpr); } Expr *getSubExpr() { return cast(SubExpr); } @@ -964,9 +941,9 @@ public: // Implement isa/cast/dyncast/etc. static bool classof(const Stmt *T) { - return T->getStmtClass() == CXXExprWithCleanupClass; + return T->getStmtClass() == CXXExprWithTemporariesClass; } - static bool classof(const CXXExprWithCleanup *) { return true; } + static bool classof(const CXXExprWithTemporaries *) { return true; } // Iterators virtual child_iterator child_begin(); diff --git a/include/clang/AST/StmtNodes.def b/include/clang/AST/StmtNodes.def index 8d1045864b..eb51829165 100644 --- a/include/clang/AST/StmtNodes.def +++ b/include/clang/AST/StmtNodes.def @@ -120,7 +120,7 @@ STMT(QualifiedDeclRefExpr , DeclRefExpr) STMT(UnresolvedDeclRefExpr , Expr) STMT(CXXDestroyExpr , Expr) STMT(CXXConstructExpr , Expr) -STMT(CXXExprWithCleanup , Expr) +STMT(CXXExprWithTemporaries , Expr) STMT(CXXTemporaryObjectExpr , CXXConstructExpr) // Obj-C Expressions. diff --git a/lib/AST/ExprCXX.cpp b/lib/AST/ExprCXX.cpp index dc0b57372f..c28086147f 100644 --- a/lib/AST/ExprCXX.cpp +++ b/lib/AST/ExprCXX.cpp @@ -274,9 +274,10 @@ CXXDestroyExpr *CXXDestroyExpr::Create(ASTContext &C, VarDecl *vd) { return new (C) CXXDestroyExpr(vd, C.VoidTy); } -CXXExprWithCleanup::CXXExprWithCleanup(Expr *subexpr, CXXTempVarDecl **decls, - unsigned numdecls) -: Expr(CXXExprWithCleanupClass, subexpr->getType(), +CXXExprWithTemporaries::CXXExprWithTemporaries(Expr *subexpr, + CXXTempVarDecl **decls, + unsigned numdecls) +: Expr(CXXExprWithTemporariesClass, subexpr->getType(), subexpr->isTypeDependent(), subexpr->isValueDependent()), SubExpr(subexpr), Decls(0), NumDecls(numdecls) { if (NumDecls > 0) { @@ -286,7 +287,7 @@ CXXExprWithCleanup::CXXExprWithCleanup(Expr *subexpr, CXXTempVarDecl **decls, } } -CXXExprWithCleanup::~CXXExprWithCleanup() { +CXXExprWithTemporaries::~CXXExprWithTemporaries() { delete[] Decls; } @@ -306,7 +307,7 @@ Stmt::child_iterator CXXDestroyExpr::child_end() { return child_iterator(); } -// CXXExprWithCleanup -Stmt::child_iterator CXXExprWithCleanup::child_begin() { return &SubExpr; } -Stmt::child_iterator CXXExprWithCleanup::child_end() { return &SubExpr + 1; } +// CXXExprWithTemporaries +Stmt::child_iterator CXXExprWithTemporaries::child_begin() { return &SubExpr; } +Stmt::child_iterator CXXExprWithTemporaries::child_end() { return &SubExpr + 1;} diff --git a/lib/AST/StmtPrinter.cpp b/lib/AST/StmtPrinter.cpp index 1a74937be9..c083efac9b 100644 --- a/lib/AST/StmtPrinter.cpp +++ b/lib/AST/StmtPrinter.cpp @@ -1105,7 +1105,7 @@ void StmtPrinter::VisitCXXDestroyExpr(CXXDestroyExpr *E) { // Nothing to print. } -void StmtPrinter::VisitCXXExprWithCleanup(CXXExprWithCleanup *E) { +void StmtPrinter::VisitCXXExprWithTemporaries(CXXExprWithTemporaries *E) { // Just forward to the sub expression. PrintExpr(E->getSubExpr()); } -- 2.40.0