[Polly][PATCH] Use reference to clarify pointer can never be null

Johannes Doerfert doerfert at cs.uni-saarland.de
Sat Apr 18 06:58:34 PDT 2015


> -const ScopDetection::BoxedLoopsSetTy *
> +const ScopDetection::BoxedLoopsSetTy &
>  ScopDetection::getBoxedLoops(const Region *R) const {
> -  auto BLMIt = BoxedLoopsMap.find(R);
> -  if (BLMIt == BoxedLoopsMap.end())
> -    return nullptr;
> -  return &BLMIt->second;
> +  return BoxedLoopsMap.find(R)->second;
>  }
Are you sure the access of ->second is actually legal if find returns
BoxedLoopsMap.end() ?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 213 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150418/39330c14/attachment.sig>


More information about the llvm-commits mailing list