diff options
| author | Chandler Carruth <chandlerc@gmail.com> | 2014-03-10 01:32:25 +0000 |
|---|---|---|
| committer | Chandler Carruth <chandlerc@gmail.com> | 2014-03-10 01:32:25 +0000 |
| commit | ca7fbae3f6a4df35755b05eaf0bb7890fb435778 (patch) | |
| tree | 4b4febb755c143c6169e419f5e2dc496df9cd42d | |
| parent | 596587f6d0bf932f4a97100790a2d75d41250b1c (diff) | |
| download | bcm5719-llvm-ca7fbae3f6a4df35755b05eaf0bb7890fb435778.tar.gz bcm5719-llvm-ca7fbae3f6a4df35755b05eaf0bb7890fb435778.zip | |
[PM] As Dave noticed in review, I had erroneously copied the move
constructors from the classes which only have a single reference member
to many other places. This resulted in them copying their single member
instead of moving. =/ Fix this.
There's really not a useful test to add sadly because these move
constructors are only called when something deep inside some standard
library implementation *needs* to move them. Many of the types aren't
even user-impacting types. Or, the objects are copyable anyways and so
the result was merely a performance problem rather than a correctness
problem.
Anyways, thanks for the review. And this is a great example of why
I wish I colud have the compiler write these for me.
llvm-svn: 203431
| -rw-r--r-- | llvm/include/llvm/IR/PassManager.h | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/llvm/include/llvm/IR/PassManager.h b/llvm/include/llvm/IR/PassManager.h index e16524577f9..74a6d99a4a4 100644 --- a/llvm/include/llvm/IR/PassManager.h +++ b/llvm/include/llvm/IR/PassManager.h @@ -70,7 +70,7 @@ public: PreservedAnalyses(const PreservedAnalyses &Arg) : PreservedPassIDs(Arg.PreservedPassIDs) {} PreservedAnalyses(PreservedAnalyses &&Arg) - : PreservedPassIDs(Arg.PreservedPassIDs) {} + : PreservedPassIDs(std::move(Arg.PreservedPassIDs)) {} PreservedAnalyses &operator=(PreservedAnalyses RHS) { std::swap(*this, RHS); return *this; @@ -207,7 +207,7 @@ struct PassModel<IRUnitT, AnalysisManagerT, PassT, // We have to explicitly define all the special member functions because MSVC // refuses to generate them. PassModel(const PassModel &Arg) : Pass(Arg.Pass) {} - PassModel(PassModel &&Arg) : Pass(Arg.Pass) {} + PassModel(PassModel &&Arg) : Pass(std::move(Arg.Pass)) {} PassModel &operator=(PassModel RHS) { std::swap(*this, RHS); return *this; @@ -229,7 +229,7 @@ struct PassModel<IRUnitT, AnalysisManagerT, PassT, // We have to explicitly define all the special member functions because MSVC // refuses to generate them. PassModel(const PassModel &Arg) : Pass(Arg.Pass) {} - PassModel(PassModel &&Arg) : Pass(Arg.Pass) {} + PassModel(PassModel &&Arg) : Pass(std::move(Arg.Pass)) {} PassModel &operator=(PassModel RHS) { std::swap(*this, RHS); return *this; @@ -298,7 +298,8 @@ struct AnalysisResultModel<IRUnitT, PassT, ResultT, // We have to explicitly define all the special member functions because MSVC // refuses to generate them. AnalysisResultModel(const AnalysisResultModel &Arg) : Result(Arg.Result) {} - AnalysisResultModel(AnalysisResultModel &&Arg) : Result(Arg.Result) {} + AnalysisResultModel(AnalysisResultModel &&Arg) + : Result(std::move(Arg.Result)) {} AnalysisResultModel &operator=(AnalysisResultModel RHS) { std::swap(*this, RHS); return *this; @@ -325,7 +326,8 @@ struct AnalysisResultModel<IRUnitT, PassT, ResultT, // We have to explicitly define all the special member functions because MSVC // refuses to generate them. AnalysisResultModel(const AnalysisResultModel &Arg) : Result(Arg.Result) {} - AnalysisResultModel(AnalysisResultModel &&Arg) : Result(Arg.Result) {} + AnalysisResultModel(AnalysisResultModel &&Arg) + : Result(std::move(Arg.Result)) {} AnalysisResultModel &operator=(AnalysisResultModel RHS) { std::swap(*this, RHS); return *this; @@ -374,7 +376,7 @@ struct AnalysisPassModel<IRUnitT, AnalysisManagerT, PassT, // We have to explicitly define all the special member functions because MSVC // refuses to generate them. AnalysisPassModel(const AnalysisPassModel &Arg) : Pass(Arg.Pass) {} - AnalysisPassModel(AnalysisPassModel &&Arg) : Pass(Arg.Pass) {} + AnalysisPassModel(AnalysisPassModel &&Arg) : Pass(std::move(Arg.Pass)) {} AnalysisPassModel &operator=(AnalysisPassModel RHS) { std::swap(*this, RHS); return *this; @@ -405,7 +407,7 @@ struct AnalysisPassModel<IRUnitT, AnalysisManagerT, PassT, // We have to explicitly define all the special member functions because MSVC // refuses to generate them. AnalysisPassModel(const AnalysisPassModel &Arg) : Pass(Arg.Pass) {} - AnalysisPassModel(AnalysisPassModel &&Arg) : Pass(Arg.Pass) {} + AnalysisPassModel(AnalysisPassModel &&Arg) : Pass(std::move(Arg.Pass)) {} AnalysisPassModel &operator=(AnalysisPassModel RHS) { std::swap(*this, RHS); return *this; |

