[llvm-commits] [llvm] r172735 - /llvm/trunk/lib/Transforms/Scalar/ObjCARC.cpp
Michael Gottesman
mgottesman at apple.com
Thu Jan 17 10:36:43 PST 2013
I added the missing const in r172736.
On Jan 17, 2013, at 10:32 AM, Michael Gottesman <mgottesman at apple.com> wrote:
> Author: mgottesman
> Date: Thu Jan 17 12:32:34 2013
> New Revision: 172735
>
> URL: http://llvm.org/viewvc/llvm-project?rev=172735&view=rev
> Log:
> [ObjCARC] Implemented operator<< for InstructionClass and changed a ``Visited'' Debug message to use it.
>
> Modified:
> llvm/trunk/lib/Transforms/Scalar/ObjCARC.cpp
>
> Modified: llvm/trunk/lib/Transforms/Scalar/ObjCARC.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/ObjCARC.cpp?rev=172735&r1=172734&r2=172735&view=diff
> ==============================================================================
> --- llvm/trunk/lib/Transforms/Scalar/ObjCARC.cpp (original)
> +++ llvm/trunk/lib/Transforms/Scalar/ObjCARC.cpp Thu Jan 17 12:32:34 2013
> @@ -167,6 +167,59 @@
> IC_User, ///< could "use" a pointer
> IC_None ///< anything else
> };
> +
> + raw_ostream &operator<<(raw_ostream &OS, const InstructionClass Class)
> + LLVM_ATTRIBUTE_USED;
> + raw_ostream &operator<<(raw_ostream &OS, InstructionClass Class) {
> + switch (Class) {
> + case IC_Retain:
> + return OS << "IC_Retain";
> + case IC_RetainRV:
> + return OS << "IC_RetainRV";
> + case IC_RetainBlock:
> + return OS << "IC_RetainBlock";
> + case IC_Release:
> + return OS << "IC_Release";
> + case IC_Autorelease:
> + return OS << "IC_Autorelease";
> + case IC_AutoreleaseRV:
> + return OS << "IC_AutoreleaseRV";
> + case IC_AutoreleasepoolPush:
> + return OS << "IC_AutoreleasepoolPush";
> + case IC_AutoreleasepoolPop:
> + return OS << "IC_AutoreleasepoolPop";
> + case IC_NoopCast:
> + return OS << "IC_NoopCast";
> + case IC_FusedRetainAutorelease:
> + return OS << "IC_FusedRetainAutorelease";
> + case IC_FusedRetainAutoreleaseRV:
> + return OS << "IC_FusedRetainAutoreleaseRV";
> + case IC_LoadWeakRetained:
> + return OS << "IC_LoadWeakRetained";
> + case IC_StoreWeak:
> + return OS << "IC_StoreWeak";
> + case IC_InitWeak:
> + return OS << "IC_InitWeak";
> + case IC_LoadWeak:
> + return OS << "IC_LoadWeak";
> + case IC_MoveWeak:
> + return OS << "IC_MoveWeak";
> + case IC_CopyWeak:
> + return OS << "IC_CopyWeak";
> + case IC_DestroyWeak:
> + return OS << "IC_DestroyWeak";
> + case IC_StoreStrong:
> + return OS << "IC_StoreStrong";
> + case IC_CallOrUser:
> + return OS << "IC_CallOrUser";
> + case IC_Call:
> + return OS << "IC_Call";
> + case IC_User:
> + return OS << "IC_User";
> + case IC_None:
> + return OS << "IC_None";
> + }
> + }
> }
>
> /// \brief Test whether the given value is possible a reference-counted pointer.
> @@ -2387,11 +2440,11 @@
> for (inst_iterator I = inst_begin(&F), E = inst_end(&F); I != E; ) {
> Instruction *Inst = &*I++;
>
> - DEBUG(dbgs() << "ObjCARCOpt::OptimizeIndividualCalls: Visiting: " <<
> - *Inst << "\n");
> -
> InstructionClass Class = GetBasicInstructionClass(Inst);
>
> + DEBUG(dbgs() << "ObjCARCOpt::OptimizeIndividualCalls: Visiting: Class: " << Class
> + << "; " << *Inst << "\n");
> +
> switch (Class) {
> default: break;
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list