diff options
author | Steve Naroff <snaroff@apple.com> | 2008-09-22 15:31:56 +0000 |
---|---|---|
committer | Steve Naroff <snaroff@apple.com> | 2008-09-22 15:31:56 +0000 |
commit | 33ae3afcf893ee0af25401409ba1246d9cee1774 (patch) | |
tree | b83813eda8f7b930e1fff8acea96aa71c36cca31 /lib | |
parent | 4f9b9f1e6848904fdeca0a9cd693940ecf566bc1 (diff) |
Remove unused slot/reference and update Sema::ActOnIdentifierExpr().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@56438 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Sema/Sema.h | 1 | ||||
-rw-r--r-- | lib/Sema/SemaExpr.cpp | 9 |
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/Sema/Sema.h b/lib/Sema/Sema.h index 99ce5a7429..4fbd735113 100644 --- a/lib/Sema/Sema.h +++ b/lib/Sema/Sema.h @@ -1038,7 +1038,6 @@ public: /// 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; diff --git a/lib/Sema/SemaExpr.cpp b/lib/Sema/SemaExpr.cpp index b7d5c8e12c..e374a035cb 100644 --- a/lib/Sema/SemaExpr.cpp +++ b/lib/Sema/SemaExpr.cpp @@ -436,11 +436,12 @@ Sema::ExprResult Sema::ActOnIdentifierExpr(Scope *S, SourceLocation Loc, // 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); } |