aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-05-30 19:54:15 +0000
committerAnders Carlsson <andersca@mac.com>2009-05-30 19:54:15 +0000
commitc1ce477119fed070299668aab24084b17ff5f14b (patch)
treeab7dd3a024e9bd0ad0b70d9dc7d1ccdf48059187
parentf89bb0fa8b2b806b0a3ad23619c1f5acb4aa952a (diff)
Add a CXXTemporary class. Not used yet.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72626 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--include/clang/AST/ExprCXX.h13
-rw-r--r--lib/AST/ExprCXX.cpp6
2 files changed, 19 insertions, 0 deletions
diff --git a/include/clang/AST/ExprCXX.h b/include/clang/AST/ExprCXX.h
index b7fb7d8029..13df65047f 100644
--- a/include/clang/AST/ExprCXX.h
+++ b/include/clang/AST/ExprCXX.h
@@ -21,6 +21,7 @@
namespace clang {
class CXXConstructorDecl;
+ class CXXDestructorDecl;
class CXXTempVarDecl;
//===--------------------------------------------------------------------===//
@@ -411,6 +412,18 @@ public:
virtual child_iterator child_end();
};
+/// CXXTemporary - Represents a C++ temporary.
+class CXXTemporary {
+ /// Destructor - The destructor that needs to be called.
+ CXXDestructorDecl *Destructor;
+
+ CXXTemporary(CXXDestructorDecl *destructor)
+ : Destructor(destructor) { }
+
+public:
+ static CXXTemporary *Create(ASTContext &C, CXXDestructorDecl *Destructor);
+};
+
/// CXXConstructExpr - Represents a call to a C++ constructor.
class CXXConstructExpr : public Expr {
VarDecl *VD;
diff --git a/lib/AST/ExprCXX.cpp b/lib/AST/ExprCXX.cpp
index c3195b17c7..16b9c4b67b 100644
--- a/lib/AST/ExprCXX.cpp
+++ b/lib/AST/ExprCXX.cpp
@@ -236,6 +236,12 @@ const char *CXXNamedCastExpr::getCastName() const {
}
}
+CXXTemporary *CXXTemporary::Create(ASTContext &C,
+ CXXDestructorDecl *Destructor) {
+ // FIXME: Allocate using the ASTContext.
+ return new CXXTemporary(Destructor);
+}
+
CXXTemporaryObjectExpr::CXXTemporaryObjectExpr(ASTContext &C, VarDecl *vd,
CXXConstructorDecl *Cons,
QualType writtenTy,