[llvm] ff60a84 - Convert copy to r-value reference. (#85606)

via llvm-commits llvm-commits at lists.llvm.org
Mon Mar 18 23:15:32 PDT 2024


Author: Malay Sanghi
Date: 2024-03-19T14:15:29+08:00
New Revision: ff60a84f04b4d8af63d581d4f9dd7ab0196a200e

URL: https://github.com/llvm/llvm-project/commit/ff60a84f04b4d8af63d581d4f9dd7ab0196a200e
DIFF: https://github.com/llvm/llvm-project/commit/ff60a84f04b4d8af63d581d4f9dd7ab0196a200e.diff

LOG: Convert copy to r-value reference. (#85606)

That seems to be the intention based on calling code.

Added: 
    

Modified: 
    llvm/include/llvm/CodeGen/MachinePassManager.h

Removed: 
    


################################################################################
diff  --git a/llvm/include/llvm/CodeGen/MachinePassManager.h b/llvm/include/llvm/CodeGen/MachinePassManager.h
index b1166e3a3fd529..3faffe5c4cab29 100644
--- a/llvm/include/llvm/CodeGen/MachinePassManager.h
+++ b/llvm/include/llvm/CodeGen/MachinePassManager.h
@@ -56,7 +56,7 @@ struct MachinePassConcept
 };
 
 template <typename PassT> struct MachinePassModel : MachinePassConcept {
-  explicit MachinePassModel(PassT Pass) : Pass(std::move(Pass)) {}
+  explicit MachinePassModel(PassT &&Pass) : Pass(std::move(Pass)) {}
   // We have to explicitly define all the special member functions because MSVC
   // refuses to generate them.
   MachinePassModel(const MachinePassModel &Arg) : Pass(Arg.Pass) {}


        


More information about the llvm-commits mailing list