aboutsummaryrefslogtreecommitdiff
path: root/lib/ARCMigrate/TransRetainReleaseDealloc.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
commite7ef8556f4ee3012a0479308c993af0fbee448df (patch)
tree0691924d5d903c2b57d7fe45365ac6ede5dfd7e4 /lib/ARCMigrate/TransRetainReleaseDealloc.cpp
parent81eecde879712729712966b60c0cb1540b41293b (diff)
[arcmt] For GC, cleanup and turn -finalize to -dealloc.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143701 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ARCMigrate/TransRetainReleaseDealloc.cpp')
-rw-r--r--lib/ARCMigrate/TransRetainReleaseDealloc.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/ARCMigrate/TransRetainReleaseDealloc.cpp b/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
index 394f8480e1..bf2517f119 100644
--- a/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
+++ b/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
@@ -36,13 +36,15 @@ class RetainReleaseDeallocRemover :
ExprSet Removables;
llvm::OwningPtr<ParentMap> StmtMap;
- Selector DelegateSel;
+ Selector DelegateSel, FinalizeSel;
public:
RetainReleaseDeallocRemover(MigrationPass &pass)
: Body(0), Pass(pass) {
DelegateSel =
Pass.Ctx.Selectors.getNullarySelector(&Pass.Ctx.Idents.get("delegate"));
+ FinalizeSel =
+ Pass.Ctx.Selectors.getNullarySelector(&Pass.Ctx.Idents.get("finalize"));
}
void transformBody(Stmt *body) {
@@ -55,6 +57,8 @@ public:
bool VisitObjCMessageExpr(ObjCMessageExpr *E) {
switch (E->getMethodFamily()) {
default:
+ if (E->isInstanceMessage() && E->getSelector() == FinalizeSel)
+ break;
return true;
case OMF_autorelease:
if (isRemovable(E)) {
@@ -211,7 +215,7 @@ private:
} // anonymous namespace
-void trans::removeRetainReleaseDealloc(MigrationPass &pass) {
+void trans::removeRetainReleaseDeallocFinalize(MigrationPass &pass) {
BodyTransform<RetainReleaseDeallocRemover> trans(pass);
trans.TraverseDecl(pass.Ctx.getTranslationUnitDecl());
}