[cfe-commits] r50795 - /cfe/trunk/lib/Analysis/CFRefCount.cpp

Steve Naroff snaroff at apple.com
Wed May 7 10:45:02 PDT 2008


Ted,

VC++ doesn't seem to like strcasestr. I tried including <string>  
explicitly and it didn't help.

Can you remove your dependency on this routine?

Thanks,

snaroff

On May 6, 2008, at 8:45 PM, Ted Kremenek wrote:

> Author: kremenek
> Date: Tue May  6 22:45:05 2008
> New Revision: 50795
>
> URL: http://llvm.org/viewvc/llvm-project?rev=50795&view=rev
> Log:
> Added auto-summary generation for createXXX, copyXXX, newXXX methods.
>
> Modified:
>    cfe/trunk/lib/Analysis/CFRefCount.cpp
>
> Modified: cfe/trunk/lib/Analysis/CFRefCount.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Analysis/CFRefCount.cpp?rev=50795&r1=50794&r2=50795&view=diff
>
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> = 
> ======================================================================
> --- cfe/trunk/lib/Analysis/CFRefCount.cpp (original)
> +++ cfe/trunk/lib/Analysis/CFRefCount.cpp Tue May  6 22:45:05 2008
> @@ -593,33 +593,29 @@
>   }
> #endif
>
> +  if (!ME->getType()->isPointerType())
> +    return 0;
> +
>   // "initXXX": pass-through for receiver.
>
>   const char* s = S.getIdentifierInfoForSlot(0)->getName();
> +  assert (ScratchArgs.empty());
>
>   if (strncmp(s, "init", 4) == 0)
>     return getInitMethodSummary(S);
>
> -#if 0
> -  // Generate a summary.  For all "setYYY:" and "addXXX:" slots =>  
> StopTracking.
> -
> -  assert (ScratchArgs.empty());
> -
> -  if (S.isUnarySelector()) {
> -    RetainSummary* Summ =  
> getPersistentSummary(RetEffect::MakeNoRet());
> -    return Summ;
> -  }
> +  // "copyXXX", "createXXX", "newXXX": allocators.
>
> -  for (unsigned i = 0, e = ME->getNumArgs(); i!=e; ++i) {
> -    IdentifierInfo *II = S.getIdentifierInfoForSlot(i);
> -    const char* s = II->getName();
> -
> -    if (strncmp(s, "set", 3) == 0 || strncmp(s, "add", 3) == 0)
> -      ScratchArgs.push_back(std::make_pair(i, StopTracking));
> +  if (strcasestr(s, "create") == 0 || strcasestr(s, "copy") == 0 ||
> +      strcasestr(s, "new") == 0) {
>
> +    RetEffect E = isGCEnabled() ? RetEffect::MakeNoRet()
> +                                : RetEffect::MakeOwned();
>
> +    RetainSummary* Summ = getPersistentSummary(E);
> +    ObjCMethSummaries[S] = Summ;
> +    return Summ;
>   }
> -#endif
>
>   return 0;
> }
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits




More information about the cfe-commits mailing list