[cfe-commits] r56438 - in /cfe/trunk/lib/Sema: Sema.h SemaExpr.cpp

Steve Naroff snaroff at apple.com
Mon Sep 22 08:31:59 PDT 2008


Author: snaroff
Date: Mon Sep 22 10:31:56 2008
New Revision: 56438

URL: http://llvm.org/viewvc/llvm-project?rev=56438&view=rev
Log:
Remove unused slot/reference and update Sema::ActOnIdentifierExpr().

Modified:
    cfe/trunk/lib/Sema/Sema.h
    cfe/trunk/lib/Sema/SemaExpr.cpp

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

==============================================================================
--- cfe/trunk/lib/Sema/Sema.h (original)
+++ cfe/trunk/lib/Sema/Sema.h Mon Sep 22 10:31:56 2008
@@ -1038,7 +1038,6 @@
 /// about the block.  It is pointed to from Sema::CurBlock.
 struct BlockSemaInfo {
   llvm::SmallVector<ParmVarDecl*, 8> Params;
-  llvm::SmallPtrSet<Decl*, 4> ByRefVars;
   bool hasPrototype;
   bool isVariadic;
   

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

==============================================================================
--- cfe/trunk/lib/Sema/SemaExpr.cpp (original)
+++ cfe/trunk/lib/Sema/SemaExpr.cpp Mon Sep 22 10:31:56 2008
@@ -436,11 +436,12 @@
   // If we are in a block and the variable is outside the current block,
   // bind the variable reference with a BlockDeclRefExpr.
   
-  // If the variable is in the byref set, bind it directly, otherwise it will be
-  // bound by-copy, thus we make it const within the closure.
-  if (!CurBlock->ByRefVars.count(VD))
-    VD->getType().addConst();
+  // The BlocksAttr indicates the variable is bound by-reference.
+  if (VD->getAttr<BlocksAttr>())
+    return new BlockDeclRefExpr(VD, VD->getType(), Loc, true);
     
+  // Variable will be bound by-copy, make it const within the closure.
+  VD->getType().addConst();
   return new BlockDeclRefExpr(VD, VD->getType(), Loc, false);
 }
 





More information about the cfe-commits mailing list