[lld] r232015 - Avoid an unused variable warning when assertions are off

David Blaikie dblaikie at gmail.com
Thu Mar 12 12:49:28 PDT 2015


On Wed, Mar 11, 2015 at 11:50 PM, Justin Bogner <mail at justinbogner.com>
wrote:

> Author: bogner
> Date: Thu Mar 12 01:50:54 2015
> New Revision: 232015
>
> URL: http://llvm.org/viewvc/llvm-project?rev=232015&view=rev
> Log:
> Avoid an unused variable warning when assertions are off
>
> Patch by Mike Edwards. Thanks!
>
> Modified:
>     lld/trunk/lib/ReaderWriter/MachO/StubsPass.cpp
>
> Modified: lld/trunk/lib/ReaderWriter/MachO/StubsPass.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/StubsPass.cpp?rev=232015&r1=232014&r2=232015&view=diff
>
> ==============================================================================
> --- lld/trunk/lib/ReaderWriter/MachO/StubsPass.cpp (original)
> +++ lld/trunk/lib/ReaderWriter/MachO/StubsPass.cpp Thu Mar 12 01:50:54 2015
> @@ -274,6 +274,7 @@ public:
>        }
>      }
>      assert(binderFound && "dyld_stub_binder not found");
> +    (void)binderFound;
>

Simplified this a bit further by using std::find_if, thus avoiding the
assert-only variable entirely, in r232088.


>
>      // Sort targets by name, so stubs and lazy pointers are consistent
>      std::vector<const Atom *> targetsNeedingStubs;
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150312/f35c56c4/attachment.html>


More information about the llvm-commits mailing list