From 48239c753abd4bdc9424f6df2b8ddd43840f93c3 Mon Sep 17 00:00:00 2001 From: Michael Gottesman Date: Sun, 6 Jan 2013 21:07:11 +0000 Subject: [PATCH] Added debug message to ObjCARC when we transform an objc_autoreleaseReturnValue => objc_autorelease due to its operand not being used as a return value. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@171669 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Transforms/Scalar/ObjCARC.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/lib/Transforms/Scalar/ObjCARC.cpp b/lib/Transforms/Scalar/ObjCARC.cpp index 2a8a50e451f..a17ff50c046 100644 --- a/lib/Transforms/Scalar/ObjCARC.cpp +++ b/lib/Transforms/Scalar/ObjCARC.cpp @@ -2298,8 +2298,20 @@ ObjCARCOpt::OptimizeAutoreleaseRVCall(Function &F, Instruction *AutoreleaseRV) { Changed = true; ++NumPeeps; + + DEBUG(dbgs() << "ObjCARCOpt::OptimizeAutoreleaseRVCall: Transforming " + "objc_autoreleaseReturnValue => " + "objc_autorelease since its operand is not used as a return " + "value.\n" + " Old: " + << *AutoreleaseRV << "\n"); + cast(AutoreleaseRV)-> setCalledFunction(getAutoreleaseCallee(F.getParent())); + + DEBUG(dbgs() << " New: " + << *AutoreleaseRV << "\n"); + } /// OptimizeIndividualCalls - Visit each call, one at a time, and make