[llvm] r301152 - [Orc] Fix a warning by removing an unused lambda capture.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 24 09:13:09 PDT 2017


Generally if a lambda's only going to be used within its own scope - I'd
suggest using [&]. I think of such lambdas as basically programmatic
control flow (like an if, while, etc) - so there's no need to explicitly
state which variables you'll use within this nested scope.

On Sun, Apr 23, 2017 at 6:34 PM Lang Hames via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: lhames
> Date: Sun Apr 23 20:21:23 2017
> New Revision: 301152
>
> URL: http://llvm.org/viewvc/llvm-project?rev=301152&view=rev
> Log:
> [Orc] Fix a warning by removing an unused lambda capture.
>
> Modified:
>     llvm/trunk/include/llvm/ExecutionEngine/Orc/RPCSerialization.h
>
> Modified: llvm/trunk/include/llvm/ExecutionEngine/Orc/RPCSerialization.h
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ExecutionEngine/Orc/RPCSerialization.h?rev=301152&r1=301151&r2=301152&view=diff
>
> ==============================================================================
> --- llvm/trunk/include/llvm/ExecutionEngine/Orc/RPCSerialization.h
> (original)
> +++ llvm/trunk/include/llvm/ExecutionEngine/Orc/RPCSerialization.h Sun Apr
> 23 20:21:23 2017
> @@ -378,7 +378,7 @@ public:
>        return serializeSeq(C, std::string());
>
>      return handleErrors(std::move(Err),
> -                        [&C, &Lock](const ErrorInfoBase &EIB) {
> +                        [&C](const ErrorInfoBase &EIB) {
>                            auto SI =
> Serializers.find(EIB.dynamicClassID());
>                            if (SI == Serializers.end())
>                              return serializeAsStringError(C, EIB);
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://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/20170424/91894e6e/attachment.html>


More information about the llvm-commits mailing list