[cfe-commits] r72626 - in /cfe/trunk: include/clang/AST/ExprCXX.h lib/AST/ExprCXX.cpp
Anders Carlsson
andersca at mac.com
Sat May 30 12:54:16 PDT 2009
Author: andersca
Date: Sat May 30 14:54:15 2009
New Revision: 72626
URL: http://llvm.org/viewvc/llvm-project?rev=72626&view=rev
Log:
Add a CXXTemporary class. Not used yet.
Modified:
cfe/trunk/include/clang/AST/ExprCXX.h
cfe/trunk/lib/AST/ExprCXX.cpp
Modified: cfe/trunk/include/clang/AST/ExprCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ExprCXX.h?rev=72626&r1=72625&r2=72626&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/ExprCXX.h (original)
+++ cfe/trunk/include/clang/AST/ExprCXX.h Sat May 30 14:54:15 2009
@@ -21,6 +21,7 @@
namespace clang {
class CXXConstructorDecl;
+ class CXXDestructorDecl;
class CXXTempVarDecl;
//===--------------------------------------------------------------------===//
@@ -411,6 +412,18 @@
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;
Modified: cfe/trunk/lib/AST/ExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprCXX.cpp?rev=72626&r1=72625&r2=72626&view=diff
==============================================================================
--- cfe/trunk/lib/AST/ExprCXX.cpp (original)
+++ cfe/trunk/lib/AST/ExprCXX.cpp Sat May 30 14:54:15 2009
@@ -236,6 +236,12 @@
}
}
+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,
More information about the cfe-commits
mailing list