]> granicus.if.org Git - clang/commitdiff
Add a CXXTemporary class. Not used yet.
authorAnders Carlsson <andersca@mac.com>
Sat, 30 May 2009 19:54:15 +0000 (19:54 +0000)
committerAnders Carlsson <andersca@mac.com>
Sat, 30 May 2009 19:54:15 +0000 (19:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72626 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/AST/ExprCXX.h
lib/AST/ExprCXX.cpp

index b7fb7d8029ebf3548917d32ffc3f0d5eb1d49806..13df65047f050dad91db4deff1b38d3a1bdd0828 100644 (file)
@@ -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;
index c3195b17c7fcb03fc3e1baf109c03f0e29851c8b..16b9c4b67b0695cc546f24672d0f23007b1c6fbc 100644 (file)
@@ -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,