Remove std::move on return when it could prevent copy elision.
[oota-llvm.git] / include / llvm / IR / PassManager.h
index 3c24e7231a15fccd25fc7542437154713aecc2a3..b566f01ca8bbb18b4a2e50cbc48d9e416783663b 100644 (file)
@@ -509,7 +509,7 @@ private:
   PreservedAnalyses invalidateImpl(IRUnitT &IR, PreservedAnalyses PA) {
     // Short circuit for a common case of all analyses being preserved.
     if (PA.areAllPreserved())
-      return std::move(PA);
+      return PA;
 
     if (DebugLogging)
       dbgs() << "Invalidating all non-preserved analyses for: "
@@ -549,7 +549,7 @@ private:
     if (ResultsList.empty())
       AnalysisResultLists.erase(&IR);
 
-    return std::move(PA);
+    return PA;
   }
 
   /// \brief List of function analysis pass IDs and associated concept pointers.