diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-05-17 18:16:05 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2012-05-17 18:16:05 +0000 |
commit | b6a1b10a8d9e0405b7a0d12273623c7f4d23f7d9 (patch) | |
tree | 9cbdb3e8fbe67f381059824408cce43e9ba964fa /lib/ARCMigrate/TransRetainReleaseDealloc.cpp | |
parent | eecb22b916b6bd19655515d59a01ebd0dad37ab6 (diff) |
[arcmt] Remove the "it is not safe to remove an unused 'autorelease' message" ARC
migration error.
This is more trouble that it is worth; autoreleasing a value without holding on it
is a valid use-case, we should not "punish" correct code for the minority of
broken/fragile programs that depend on the behavior of -autorelease.
rdar://9914061
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156999 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/ARCMigrate/TransRetainReleaseDealloc.cpp')
-rw-r--r-- | lib/ARCMigrate/TransRetainReleaseDealloc.cpp | 11 |
1 files changed, 0 insertions, 11 deletions
diff --git a/lib/ARCMigrate/TransRetainReleaseDealloc.cpp b/lib/ARCMigrate/TransRetainReleaseDealloc.cpp index 11a6553341..976c097356 100644 --- a/lib/ARCMigrate/TransRetainReleaseDealloc.cpp +++ b/lib/ARCMigrate/TransRetainReleaseDealloc.cpp @@ -63,17 +63,6 @@ public: break; return true; case OMF_autorelease: - if (isRemovable(E)) { - // An unused autorelease is badness. If we remove it the receiver - // will likely die immediately while previously it was kept alive - // by the autorelease pool. This is bad practice in general, leave it - // and emit an error to force the user to restructure his code. - Pass.TA.reportError("it is not safe to remove an unused 'autorelease' " - "message; its receiver may be destroyed immediately", - E->getLocStart(), E->getSourceRange()); - return true; - } - // Pass through. case OMF_retain: case OMF_release: if (E->getReceiverKind() == ObjCMessageExpr::Instance) |