[cfe-commits] r72634 - in /cfe/trunk: include/clang/AST/ExprCXX.h lib/AST/ExprCXX.cpp lib/Sema/Sema.h lib/Sema/SemaExprCXX.cpp

Anders Carlsson andersca at mac.com
Sat May 30 14:05:26 PDT 2009


Author: andersca
Date: Sat May 30 16:05:25 2009
New Revision: 72634

URL: http://llvm.org/viewvc/llvm-project?rev=72634&view=rev
Log:
Stop using CXXTempVarDecl and use CXXTemporary instead.

Modified:
    cfe/trunk/include/clang/AST/ExprCXX.h
    cfe/trunk/lib/AST/ExprCXX.cpp
    cfe/trunk/lib/Sema/Sema.h
    cfe/trunk/lib/Sema/SemaExprCXX.cpp

Modified: cfe/trunk/include/clang/AST/ExprCXX.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/ExprCXX.h?rev=72634&r1=72633&r2=72634&view=diff

==============================================================================
--- cfe/trunk/include/clang/AST/ExprCXX.h (original)
+++ cfe/trunk/include/clang/AST/ExprCXX.h Sat May 30 16:05:25 2009
@@ -22,7 +22,7 @@
 
   class CXXConstructorDecl;
   class CXXDestructorDecl;
-  class CXXTempVarDecl;
+  class CXXTemporary;
 
 //===--------------------------------------------------------------------===//
 // C++ Expressions.
@@ -1010,12 +1010,12 @@
 class CXXExprWithTemporaries : public Expr {
   Stmt *SubExpr;
     
-  CXXTempVarDecl **Decls;
-  unsigned NumDecls;
+  CXXTemporary **Temps;
+  unsigned NumTemps;
 
 public:
-  CXXExprWithTemporaries(Expr *subexpr, CXXTempVarDecl **decls, 
-                         unsigned numdecls);
+  CXXExprWithTemporaries(Expr *subexpr, CXXTemporary **temps, 
+                         unsigned numtemps);
   ~CXXExprWithTemporaries();
 
   const Expr *getSubExpr() const { return cast<Expr>(SubExpr); }

Modified: cfe/trunk/lib/AST/ExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/ExprCXX.cpp?rev=72634&r1=72633&r2=72634&view=diff

==============================================================================
--- cfe/trunk/lib/AST/ExprCXX.cpp (original)
+++ cfe/trunk/lib/AST/ExprCXX.cpp Sat May 30 16:05:25 2009
@@ -294,20 +294,20 @@
 }
 
 CXXExprWithTemporaries::CXXExprWithTemporaries(Expr *subexpr, 
-                                               CXXTempVarDecl **decls, 
-                                               unsigned numdecls)
+                                               CXXTemporary **temps, 
+                                               unsigned numtemps)
 : Expr(CXXExprWithTemporariesClass, subexpr->getType(),
        subexpr->isTypeDependent(), subexpr->isValueDependent()), 
-  SubExpr(subexpr), Decls(0), NumDecls(numdecls) {
-  if (NumDecls > 0) {
-    Decls = new CXXTempVarDecl*[NumDecls];
-    for (unsigned i = 0; i < NumDecls; ++i)
-      Decls[i] = decls[i];
+  SubExpr(subexpr), Temps(0), NumTemps(numtemps) {
+  if (NumTemps > 0) {
+    Temps = new CXXTemporary*[NumTemps];
+    for (unsigned i = 0; i < NumTemps; ++i)
+      Temps[i] = temps[i];
   }
 }
 
 CXXExprWithTemporaries::~CXXExprWithTemporaries() {
-  delete[] Decls;
+  delete[] Temps;
 }
 
 // CXXBindTemporaryExpr

Modified: cfe/trunk/lib/Sema/Sema.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/Sema.h?rev=72634&r1=72633&r2=72634&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Sat May 30 16:05:25 2009
@@ -82,6 +82,7 @@
   class ObjCContainerDecl;
   class BasePaths;
   struct MemberLookupCriteria;
+  class CXXTemporary;
 
 /// BlockSemaInfo - When a block is being parsed, this contains information
 /// about the block.  It is pointed to from Sema::CurBlock.
@@ -165,7 +166,7 @@
 
   /// ExprTemporaries - This is the stack of temporaries that are created by 
   /// the current full expression.
-  llvm::SmallVector<CXXTempVarDecl*, 8> ExprTemporaries;
+  llvm::SmallVector<CXXTemporary*, 8> ExprTemporaries;
 
   /// CurFunctionNeedsScopeChecking - This is set to true when a function or
   /// ObjC method body contains a VLA or an ObjC try block, which introduce

Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=72634&r1=72633&r2=72634&view=diff

==============================================================================
--- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Sat May 30 16:05:25 2009
@@ -203,11 +203,7 @@
       if (!Constructor)
         return ExprError();
 
-      CXXTempVarDecl *Temp = CXXTempVarDecl::Create(Context, CurContext, Ty);
-      ExprTemporaries.push_back(Temp);
-      
       exprs.release();
-      
       Expr *E = new (Context) CXXTemporaryObjectExpr(Context, Constructor, 
                                                      Ty, TyBeginLoc, Exprs,
                                                      NumExprs, RParenLoc);





More information about the cfe-commits mailing list