[llvm] r307556 - Build fixes for pdb-diff test.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Mon Jul 10 11:52:24 PDT 2017


On Mon, Jul 10, 2017 at 10:01 AM Zachary Turner via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: zturner
> Date: Mon Jul 10 10:01:28 2017
> New Revision: 307556
>
> URL: http://llvm.org/viewvc/llvm-project?rev=307556&view=rev
> Log:
> Build fixes for pdb-diff test.
>
> Modified:
>     llvm/trunk/tools/llvm-pdbutil/Diff.cpp
>
> Modified: llvm/trunk/tools/llvm-pdbutil/Diff.cpp
> URL:
> http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-pdbutil/Diff.cpp?rev=307556&r1=307555&r2=307556&view=diff
>
> ==============================================================================
> --- llvm/trunk/tools/llvm-pdbutil/Diff.cpp (original)
> +++ llvm/trunk/tools/llvm-pdbutil/Diff.cpp Mon Jul 10 10:01:28 2017
> @@ -101,8 +101,8 @@ struct BinaryPathProvider {
>
>    SmallString<64> removeRoot(StringRef Path, bool IsRight) const {
>      SmallString<64> Native(Path);
> -    SmallString<64> Root =
> -        IsRight ? opts::diff::RightRoot : opts::diff::LeftRoot;
> +    auto &RootOpt = IsRight ? opts::diff::RightRoot :
> opts::diff::LeftRoot;
> +    SmallString<64> Root(static_cast<std::string>(RootOpt));
>      // pdb paths always use windows syntax, convert slashes to
> backslashes.
>      sys::path::native(Root, sys::path::Style::windows);
>      if (sys::path::has_stem(Root, sys::path::Style::windows))
> @@ -449,7 +449,7 @@ diffOneModule(DiffPrinter &D,
>
>    BinaryPathProvider PathProvider(28);
>    auto Iter = llvm::find_if(
> -      Other, [&Item, &PathProvider, ItemIsRight,
> +      Other, [&PathProvider, ItemIsRight,
>                L](const std::pair<uint32_t, DbiModuleDescriptor> &Other) {
>

For lambdas used locally, I'd generally favor the use of default capture
[&] - it doesn't seem important to name exactly which things are being
captured, etc. (treating local/immediately used lambdas more like scopes
-it's not important to know which outer variables are used within a 'for'
loop scope, so why would it be important for a lambda?)


>          const auto *Left = L;
>          const auto *Right = &Other;
>
>
> _______________________________________________
> 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/20170710/e85928ee/attachment.html>


More information about the llvm-commits mailing list