[llvm] 3729a5a - [SCEV] Fix a warning on an unused lambda capture

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Oct 25 11:40:44 PDT 2021


Generally if the lambda's non-escaping/locally scoped, I'd suggest using
[&] for capture to simplify the code/maintenance.

On Mon, Oct 25, 2021 at 12:45 AM Kazu Hirata via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

>
> Author: Kazu Hirata
> Date: 2021-10-25T00:45:18-07:00
> New Revision: 3729a5abf41d992535508e55c5d975f98c54dba0
>
> URL:
> https://github.com/llvm/llvm-project/commit/3729a5abf41d992535508e55c5d975f98c54dba0
> DIFF:
> https://github.com/llvm/llvm-project/commit/3729a5abf41d992535508e55c5d975f98c54dba0.diff
>
> LOG: [SCEV] Fix a warning on an unused lambda capture
>
> This patch fixes:
>
>   llvm/lib/Analysis/ScalarEvolution.cpp:12770:37: error: lambda
>   capture 'this' is not used [-Werror,-Wunused-lambda-capture]
>
> Added:
>
>
> Modified:
>     llvm/lib/Analysis/ScalarEvolution.cpp
>
> Removed:
>
>
>
>
> ################################################################################
> diff  --git a/llvm/lib/Analysis/ScalarEvolution.cpp
> b/llvm/lib/Analysis/ScalarEvolution.cpp
> index f0e3237be0a0..d3ae7da77b1a 100644
> --- a/llvm/lib/Analysis/ScalarEvolution.cpp
> +++ b/llvm/lib/Analysis/ScalarEvolution.cpp
> @@ -12767,7 +12767,7 @@ void
> ScalarEvolution::forgetMemoizedResults(ArrayRef<const SCEV *> SCEVs) {
>        ++I;
>    }
>
> -  auto RemoveSCEVFromBackedgeMap = [this, &ToForget](
> +  auto RemoveSCEVFromBackedgeMap = [&ToForget](
>        DenseMap<const Loop *, BackedgeTakenInfo> &Map) {
>          for (auto I = Map.begin(), E = Map.end(); I != E;) {
>            BackedgeTakenInfo &BEInfo = I->second;
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20211025/89d7ccdb/attachment.html>


More information about the llvm-commits mailing list