diff options
Diffstat (limited to 'lib/ARCMigrate/TransRetainReleaseDealloc.cpp')
-rw-r--r-- | lib/ARCMigrate/TransRetainReleaseDealloc.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/ARCMigrate/TransRetainReleaseDealloc.cpp b/lib/ARCMigrate/TransRetainReleaseDealloc.cpp index ed6ed0adfdf2..394f8480e112 100644 --- a/lib/ARCMigrate/TransRetainReleaseDealloc.cpp +++ b/lib/ARCMigrate/TransRetainReleaseDealloc.cpp @@ -25,7 +25,6 @@ using namespace clang; using namespace arcmt; using namespace trans; -using llvm::StringRef; namespace { @@ -130,10 +129,9 @@ public: // Change the -release to "receiver = nil" in a finally to avoid a leak // when an exception is thrown. Pass.TA.replace(E->getSourceRange(), rec->getSourceRange()); - if (Pass.Ctx.Idents.get("nil").hasMacroDefinition()) - Pass.TA.insertAfterToken(rec->getLocEnd(), " = nil"); - else - Pass.TA.insertAfterToken(rec->getLocEnd(), " = 0"); + std::string str = " = "; + str += getNilString(Pass.Ctx); + Pass.TA.insertAfterToken(rec->getLocEnd(), str); return true; } |