summaryrefslogtreecommitdiffstats
path: root/llvm
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2016-08-03 08:16:08 +0000
committerChandler Carruth <chandlerc@gmail.com>2016-08-03 08:16:08 +0000
commit1af98245f4400c96840fccb91fcfd704fedb9ff7 (patch)
treec725c39f837182a88c7f17f20adecbb0984f4175 /llvm
parent241bf2456f548b7a0f2003586180dfa6aaf401dd (diff)
downloadbcm5719-llvm-1af98245f4400c96840fccb91fcfd704fedb9ff7.tar.gz
bcm5719-llvm-1af98245f4400c96840fccb91fcfd704fedb9ff7.zip
[PM] Add the explicit copy, move, swap, and assignment boilerplate
required by MSVC 2013. This also makes the repeating pass wrapper assignable. Mildly unfortunate as it means we can't use a const member for the int, but that is a really minor invariant to try to preserve at the cost of loss of regularity of the type. Yet another annoyance of the particular C++ object / move semantic model. llvm-svn: 277582
Diffstat (limited to 'llvm')
-rw-r--r--llvm/include/llvm/IR/PassManager.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/llvm/include/llvm/IR/PassManager.h b/llvm/include/llvm/IR/PassManager.h
index 7a6364063bd..47573dad71b 100644
--- a/llvm/include/llvm/IR/PassManager.h
+++ b/llvm/include/llvm/IR/PassManager.h
@@ -995,6 +995,21 @@ template <typename PassT>
class RepeatingPassWrapper : public PassInfoMixin<RepeatingPassWrapper<PassT>> {
public:
RepeatingPassWrapper(int Count, PassT P) : Count(Count), P(std::move(P)) {}
+ // We have to explicitly define all the special member functions because MSVC
+ // refuses to generate them.
+ RepeatingPassWrapper(const RepeatingPassWrapper &Arg)
+ : Count(Arg.Count), P(Arg.P) {}
+ RepeatingPassWrapper(RepeatingPassWrapper &&Arg)
+ : Count(Arg.Count), P(std::move(Arg.P)) {}
+ friend void swap(RepeatingPassWrapper &LHS, RepeatingPassWrapper &RHS) {
+ using std::swap;
+ swap(LHS.Count, RHS.Count);
+ swap(LHS.P, RHS.P);
+ }
+ RepeatingPassWrapper &operator=(RepeatingPassWrapper RHS) {
+ swap(*this, RHS);
+ return *this;
+ }
template <typename IRUnitT, typename... Ts>
PreservedAnalyses run(IRUnitT &Arg, AnalysisManager<IRUnitT> &AM,
@@ -1006,7 +1021,7 @@ public:
}
private:
- const int Count;
+ int Count;
PassT P;
};
OpenPOWER on IntegriCloud