[cfe-commits] r97274 - /cfe/trunk/lib/Frontend/RewriteObjC.cpp
Fariborz Jahanian
fjahanian at apple.com
Fri Feb 26 13:46:28 PST 2010
Author: fjahanian
Date: Fri Feb 26 15:46:27 2010
New Revision: 97274
URL: http://llvm.org/viewvc/llvm-project?rev=97274&view=rev
Log:
Removed some unused code in rewriter.
Modified:
cfe/trunk/lib/Frontend/RewriteObjC.cpp
Modified: cfe/trunk/lib/Frontend/RewriteObjC.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/RewriteObjC.cpp?rev=97274&r1=97273&r2=97274&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/RewriteObjC.cpp (original)
+++ cfe/trunk/lib/Frontend/RewriteObjC.cpp Fri Feb 26 15:46:27 2010
@@ -124,7 +124,6 @@
llvm::SmallVector<BlockDeclRefExpr *, 32> InnerDeclRefs;
llvm::SmallVector<BlockDeclRefExpr *, 32> BlockDeclRefs;
- llvm::DenseMap<BlockDeclRefExpr *, CallExpr *> BlockCallExprs;
// Block related declarations.
llvm::SmallVector<ValueDecl *, 8> BlockByCopyDecls;
@@ -388,7 +387,6 @@
void RewriteRecordBody(RecordDecl *RD);
void CollectBlockDeclRefInfo(BlockExpr *Exp);
- void GetBlockCallExprs(Stmt *S);
void GetBlockDeclRefExprs(Stmt *S);
void GetInnerBlockDeclRefExprs(Stmt *S,
llvm::SmallVector<BlockDeclRefExpr *, 8> &InnerBlockDeclRefs,
@@ -4301,7 +4299,6 @@
BlockByRefDeclsPtrSet.clear();
BlockByCopyDecls.clear();
BlockByCopyDeclsPtrSet.clear();
- BlockCallExprs.clear();
ImportedBlockDecls.clear();
}
Blocks.clear();
@@ -4381,24 +4378,6 @@
return;
}
-void RewriteObjC::GetBlockCallExprs(Stmt *S) {
- for (Stmt::child_iterator CI = S->child_begin(), E = S->child_end();
- CI != E; ++CI)
- if (*CI) {
- if (BlockExpr *CBE = dyn_cast<BlockExpr>(*CI))
- GetBlockCallExprs(CBE->getBody());
- else
- GetBlockCallExprs(*CI);
- }
-
- if (CallExpr *CE = dyn_cast<CallExpr>(S)) {
- if (CE->getCallee()->getType()->isBlockPointerType()) {
- BlockCallExprs[dyn_cast<BlockDeclRefExpr>(CE->getCallee())] = CE;
- }
- }
- return;
-}
-
Stmt *RewriteObjC::SynthesizeBlockCall(CallExpr *Exp, const Expr *BlockExp) {
// Navigate to relevant type information.
const BlockPointerType *CPT = 0;
@@ -4955,10 +4934,8 @@
for (unsigned i = 0; i < BlockDeclRefs.size(); i++)
if (BlockDeclRefs[i]->isByRef() ||
BlockDeclRefs[i]->getType()->isObjCObjectPointerType() ||
- BlockDeclRefs[i]->getType()->isBlockPointerType()) {
- GetBlockCallExprs(BlockDeclRefs[i]);
+ BlockDeclRefs[i]->getType()->isBlockPointerType())
ImportedBlockDecls.insert(BlockDeclRefs[i]->getDecl());
- }
}
}
@@ -4990,17 +4967,14 @@
BlockByCopyDeclsPtrSet.insert(VD);
BlockByCopyDecls.push_back(VD);
if (Exp->getType()->isObjCObjectPointerType() ||
- Exp->getType()->isBlockPointerType()) {
- GetBlockCallExprs(Exp);
+ Exp->getType()->isBlockPointerType())
ImportedBlockDecls.insert(VD);
- }
}
if (Exp->isByRef() && !BlockByRefDeclsPtrSet.count(VD)) {
InnerDeclRefs.push_back(Exp); countOfInnerDecls++;
BlockDeclRefs.push_back(Exp);
BlockByRefDeclsPtrSet.insert(VD);
BlockByRefDecls.push_back(VD);
- GetBlockCallExprs(Exp);
ImportedBlockDecls.insert(VD);
}
}
More information about the cfe-commits
mailing list