[llvm] r244812 - Move the object being used to move-initialize when calling the base class' constructor from the ctor-initializer. This should have no effect given the triviality of the class, but it allows for easier maintenance should the semantics of the base class change. NFC intended.

Aaron Ballman via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 12 14:10:42 PDT 2015


Author: aaronballman
Date: Wed Aug 12 16:10:41 2015
New Revision: 244812

URL: http://llvm.org/viewvc/llvm-project?rev=244812&view=rev
Log:
Move the object being used to move-initialize when calling the base class' constructor from the ctor-initializer. This should have no effect given the triviality of the class, but it allows for easier maintenance should the semantics of the base class change. NFC intended.

Modified:
    llvm/trunk/include/llvm/Analysis/DependenceAnalysis.h

Modified: llvm/trunk/include/llvm/Analysis/DependenceAnalysis.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/Analysis/DependenceAnalysis.h?rev=244812&r1=244811&r2=244812&view=diff
==============================================================================
--- llvm/trunk/include/llvm/Analysis/DependenceAnalysis.h (original)
+++ llvm/trunk/include/llvm/Analysis/DependenceAnalysis.h Wed Aug 12 16:10:41 2015
@@ -71,6 +71,12 @@ namespace llvm {
   class Dependence {
   protected:
     Dependence(const Dependence &) = default;
+    
+    // FIXME: When we move to MSVC 2015 as the base compiler for Visual Studio
+    // support, uncomment this line to allow a defaulted move constructor for
+    // Dependence. Currently, FullDependence relies on the copy constructor, but
+    // that is acceptable given the triviality of the class.
+    // Dependence(Dependence &&) = default;
 
   public:
     Dependence(Instruction *Source,
@@ -225,7 +231,7 @@ namespace llvm {
                    unsigned Levels);
 
     FullDependence(FullDependence &&RHS)
-        : Dependence(RHS), Levels(RHS.Levels),
+        : Dependence(std::move(RHS)), Levels(RHS.Levels),
           LoopIndependent(RHS.LoopIndependent), Consistent(RHS.Consistent),
           DV(std::move(RHS.DV)) {}
 




More information about the llvm-commits mailing list