[llvm-commits] [llvm] r89468 - /llvm/trunk/lib/Analysis/CaptureTracking.cpp

Duncan Sands baldrick at free.fr
Fri Nov 20 09:59:52 PST 2009


Hi Dan,

> +      // Don't count comparisons of a no-alias return value against null as
> +      // captures. This allows us to ignore comparisons of malloc results
> +      // with null, for example.
> +      if (isNoAliasCall(V))
>          if (ConstantPointerNull *CPN =
>                dyn_cast<ConstantPointerNull>(I->getOperand(1)))
>            if (CPN->getType()->getAddressSpace() == 0)
>              break;

for a little more generality you could do: isNoAliasCall(V->stripPointerCasts())

Ciao,

Duncan.



More information about the llvm-commits mailing list