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

Pete Cooper via llvm-commits llvm-commits at lists.llvm.org
Tue Mar 22 11:09:55 PDT 2016


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;
+    }
+
+    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,




More information about the llvm-commits mailing list