[cfe-commits] r105479 - in /cfe/trunk: include/clang/AST/Expr.h lib/AST/StmtProfile.cpp lib/Frontend/PCHReaderStmt.cpp lib/Frontend/PCHWriterStmt.cpp

Fariborz Jahanian fjahanian at apple.com
Fri Jun 4 12:06:53 PDT 2010


Author: fjahanian
Date: Fri Jun  4 14:06:53 2010
New Revision: 105479

URL: http://llvm.org/viewvc/llvm-project?rev=105479&view=rev
Log:
Added a field to BlockDeclRefExpr for future use.
No functionality change yet.


Modified:
    cfe/trunk/include/clang/AST/Expr.h
    cfe/trunk/lib/AST/StmtProfile.cpp
    cfe/trunk/lib/Frontend/PCHReaderStmt.cpp
    cfe/trunk/lib/Frontend/PCHWriterStmt.cpp

Modified: cfe/trunk/include/clang/AST/Expr.h
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/include/clang/AST/Expr.h?rev=105479&r1=105478&r2=105479&view=diff
==============================================================================
--- cfe/trunk/include/clang/AST/Expr.h (original)
+++ cfe/trunk/include/clang/AST/Expr.h Fri Jun  4 14:06:53 2010
@@ -3305,12 +3305,14 @@
   SourceLocation Loc;
   bool IsByRef : 1;
   bool ConstQualAdded : 1;
+  Stmt *CopyConstructorVal;
 public:
   // FIXME: Fix type/value dependence!
   BlockDeclRefExpr(ValueDecl *d, QualType t, SourceLocation l, bool ByRef,
-                   bool constAdded = false)
+                   bool constAdded = false,
+                   Stmt *copyConstructorVal = 0)
   : Expr(BlockDeclRefExprClass, t, false, false), D(d), Loc(l), IsByRef(ByRef),
-    ConstQualAdded(constAdded) {}
+    ConstQualAdded(constAdded),  CopyConstructorVal(copyConstructorVal) {}
 
   // \brief Build an empty reference to a declared variable in a
   // block.
@@ -3331,6 +3333,12 @@
 
   bool isConstQualAdded() const { return ConstQualAdded; }
   void setConstQualAdded(bool C) { ConstQualAdded = C; }
+  
+  const Expr *getCopyConstructorExpr() const 
+    { return cast_or_null<Expr>(CopyConstructorVal); }
+  Expr *getCopyConstructorExpr() 
+    { return cast_or_null<Expr>(CopyConstructorVal); }
+  void setCopyConstructorExpr(Expr *E) { CopyConstructorVal = E; }
 
   static bool classof(const Stmt *T) {
     return T->getStmtClass() == BlockDeclRefExprClass;

Modified: cfe/trunk/lib/AST/StmtProfile.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/StmtProfile.cpp?rev=105479&r1=105478&r2=105479&view=diff
==============================================================================
--- cfe/trunk/lib/AST/StmtProfile.cpp (original)
+++ cfe/trunk/lib/AST/StmtProfile.cpp Fri Jun  4 14:06:53 2010
@@ -428,6 +428,8 @@
   VisitDecl(S->getDecl());
   ID.AddBoolean(S->isByRef());
   ID.AddBoolean(S->isConstQualAdded());
+  if (S->getCopyConstructorExpr())
+    Visit(S->getCopyConstructorExpr());
 }
 
 static Stmt::StmtClass DecodeOperatorCall(CXXOperatorCallExpr *S,

Modified: cfe/trunk/lib/Frontend/PCHReaderStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHReaderStmt.cpp?rev=105479&r1=105478&r2=105479&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PCHReaderStmt.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHReaderStmt.cpp Fri Jun  4 14:06:53 2010
@@ -764,7 +764,8 @@
   E->setLocation(SourceLocation::getFromRawEncoding(Record[Idx++]));
   E->setByRef(Record[Idx++]);
   E->setConstQualAdded(Record[Idx++]);
-  return 0;
+  E->setCopyConstructorExpr(cast_or_null<Expr>(StmtStack.back()));
+  return 1;
 }
 
 //===----------------------------------------------------------------------===//

Modified: cfe/trunk/lib/Frontend/PCHWriterStmt.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/PCHWriterStmt.cpp?rev=105479&r1=105478&r2=105479&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/PCHWriterStmt.cpp (original)
+++ cfe/trunk/lib/Frontend/PCHWriterStmt.cpp Fri Jun  4 14:06:53 2010
@@ -688,6 +688,7 @@
   Writer.AddSourceLocation(E->getLocation(), Record);
   Record.push_back(E->isByRef());
   Record.push_back(E->isConstQualAdded());
+  Writer.WriteSubStmt(E->getCopyConstructorExpr());
   Code = pch::EXPR_BLOCK_DECL_REF;
 }
 





More information about the cfe-commits mailing list