[lld] r264077 - More MSVC bot appeasement. Explicitly define rvalue methods on SortKey.

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 22 11:18:48 PDT 2016


On Tue, Mar 22, 2016 at 11:09 AM, Pete Cooper via llvm-commits <
llvm-commits at lists.llvm.org> wrote:

> Author: pete
> Date: Tue Mar 22 13:09:55 2016
> New Revision: 264077
>
> URL: http://llvm.org/viewvc/llvm-project?rev=264077&view=rev
> Log:
> More MSVC bot appeasement.  Explicitly define rvalue methods on SortKey.
>
> OwningAtomPtr does not have OwningAtomPtr(OwningAtomPtr&) or the equivalent
> operator= as we only want to use rvalue references in it.
>
> SortKey didn't like this on MSVC as it was synthesizing SortKey(SortKey&)
> and
> trying to use the OwningAtomPtr(OwningAtomPtr&) method which was private an
> unimplemented.
>
> Now we explicitly have the methods on SortKey so hopefully the bot will be
> happier.
>
> Modified:
>     lld/trunk/lib/ReaderWriter/MachO/LayoutPass.h
>
> Modified: lld/trunk/lib/ReaderWriter/MachO/LayoutPass.h
> URL:
> http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/LayoutPass.h?rev=264077&r1=264076&r2=264077&view=diff
>
> ==============================================================================
> --- lld/trunk/lib/ReaderWriter/MachO/LayoutPass.h (original)
> +++ lld/trunk/lib/ReaderWriter/MachO/LayoutPass.h Tue Mar 22 13:09:55 2016
> @@ -39,6 +39,25 @@ public:
>      OwningAtomPtr<DefinedAtom> _atom;
>      const DefinedAtom *_root;
>      uint64_t _override;
> +
> +    // Note, these are only here to appease MSVC bots which didn't like
> +    // the same methods being implemented/deleted in OwningAtomPtr.
> +    SortKey(SortKey &&key) : _atom(std::move(key._atom)),
> _root(key._root),
> +                             _override(key._override) {
> +      key._root = nullptr;
>

Why do you need to null that out? (it doesn't look like this type has a
fancy dtor that's going to try to delete _root or do anything weird with
it?) Same question in the assignment operator


> +    }
> +
> +    SortKey &operator=(SortKey &&key) {
> +      _atom = std::move(key._atom);
> +      _root = key._root;
> +      key._root = nullptr;
> +      _override = key._override;
> +      return *this;
> +    }
> +
> +  private:
> +    SortKey(const SortKey &) = delete;
> +    void operator=(const SortKey&) = delete;
>    };
>
>    typedef std::function<bool (const DefinedAtom *left, const DefinedAtom
> *right,
>
>
> _______________________________________________
> 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/20160322/993b739c/attachment.html>


More information about the llvm-commits mailing list