summaryrefslogtreecommitdiffstats
path: root/clang/lib/ARCMigrate/TransZeroOutPropsInDealloc.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-11-04 15:58:22 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2011-11-04 15:58:22 +0000
commitd2b911235479577c910efdfa7d5ac52046c2794d (patch)
treea08c66e868b0c72ea3d3fc61c203498b8c08fc35 /clang/lib/ARCMigrate/TransZeroOutPropsInDealloc.cpp
parentd8cdfbc9058fe97528dba4ca7f854045aa955cd5 (diff)
downloadbcm5719-llvm-d2b911235479577c910efdfa7d5ac52046c2794d.tar.gz
bcm5719-llvm-d2b911235479577c910efdfa7d5ac52046c2794d.zip
[arcmt] For GC, cleanup and turn -finalize to -dealloc.
llvm-svn: 143701
Diffstat (limited to 'clang/lib/ARCMigrate/TransZeroOutPropsInDealloc.cpp')
-rw-r--r--clang/lib/ARCMigrate/TransZeroOutPropsInDealloc.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/clang/lib/ARCMigrate/TransZeroOutPropsInDealloc.cpp b/clang/lib/ARCMigrate/TransZeroOutPropsInDealloc.cpp
index 1dbe8111494..7c533bcf3a0 100644
--- a/clang/lib/ARCMigrate/TransZeroOutPropsInDealloc.cpp
+++ b/clang/lib/ARCMigrate/TransZeroOutPropsInDealloc.cpp
@@ -31,9 +31,13 @@ class ZeroOutInDeallocRemover :
llvm::DenseMap<ObjCPropertyDecl*, ObjCPropertyImplDecl*> SynthesizedProperties;
ImplicitParamDecl *SelfD;
ExprSet Removables;
+ Selector FinalizeSel;
public:
- ZeroOutInDeallocRemover(MigrationPass &pass) : Pass(pass), SelfD(0) { }
+ ZeroOutInDeallocRemover(MigrationPass &pass) : Pass(pass), SelfD(0) {
+ FinalizeSel =
+ Pass.Ctx.Selectors.getNullarySelector(&Pass.Ctx.Idents.get("finalize"));
+ }
bool VisitObjCMessageExpr(ObjCMessageExpr *ME) {
ASTContext &Ctx = Pass.Ctx;
@@ -84,7 +88,8 @@ public:
}
bool TraverseObjCMethodDecl(ObjCMethodDecl *D) {
- if (D->getMethodFamily() != OMF_dealloc)
+ if (D->getMethodFamily() != OMF_dealloc &&
+ !(D->isInstanceMethod() && D->getSelector() == FinalizeSel))
return true;
if (!D->hasBody())
return true;
@@ -191,7 +196,7 @@ private:
} // anonymous namespace
-void trans::removeZeroOutPropsInDealloc(MigrationPass &pass) {
+void trans::removeZeroOutPropsInDeallocFinalize(MigrationPass &pass) {
ZeroOutInDeallocRemover trans(pass);
trans.TraverseDecl(pass.Ctx.getTranslationUnitDecl());
}
OpenPOWER on IntegriCloud