comparison lib/Support/DAGDeltaAlgorithm.cpp @ 97:b0dd3743370f

LLVM 3.8
author Kaito Tokumori <e105711@ie.u-ryukyu.ac.jp>
date Wed, 14 Oct 2015 19:39:58 +0900
parents afa8332a0e37
children
comparison
equal deleted inserted replaced
94:d52ff4b80465 97:b0dd3743370f
61 typedef std::set<change_ty>::iterator pred_closure_iterator_ty; 61 typedef std::set<change_ty>::iterator pred_closure_iterator_ty;
62 typedef std::set<change_ty>::iterator succ_closure_iterator_ty; 62 typedef std::set<change_ty>::iterator succ_closure_iterator_ty;
63 63
64 DAGDeltaAlgorithm &DDA; 64 DAGDeltaAlgorithm &DDA;
65 65
66 const changeset_ty &Changes;
67 const std::vector<edge_ty> &Dependencies;
68
69 std::vector<change_ty> Roots; 66 std::vector<change_ty> Roots;
70 67
71 /// Cache of failed test results. Successful test results are never cached 68 /// Cache of failed test results. Successful test results are never cached
72 /// since we always reduce following a success. We maintain an independent 69 /// since we always reduce following a success. We maintain an independent
73 /// cache from that used by the individual delta passes because we may get 70 /// cache from that used by the individual delta passes because we may get
137 134
138 return DDA.ExecuteOneTest(S); 135 return DDA.ExecuteOneTest(S);
139 } 136 }
140 137
141 public: 138 public:
142 DAGDeltaAlgorithmImpl(DAGDeltaAlgorithm &_DDA, 139 DAGDeltaAlgorithmImpl(DAGDeltaAlgorithm &DDA, const changeset_ty &Changes,
143 const changeset_ty &_Changes, 140 const std::vector<edge_ty> &Dependencies);
144 const std::vector<edge_ty> &_Dependencies);
145 141
146 changeset_ty Run(); 142 changeset_ty Run();
147 143
148 /// GetTestResult - Get the test result for the active set \p Changes with 144 /// GetTestResult - Get the test result for the active set \p Changes with
149 /// \p Required changes from the cache, executing the test if necessary. 145 /// \p Required changes from the cache, executing the test if necessary.
172 bool ExecuteOneTest(const changeset_ty &S) override { 168 bool ExecuteOneTest(const changeset_ty &S) override {
173 return DDAI.GetTestResult(S, Required); 169 return DDAI.GetTestResult(S, Required);
174 } 170 }
175 171
176 public: 172 public:
177 DeltaActiveSetHelper(DAGDeltaAlgorithmImpl &_DDAI, 173 DeltaActiveSetHelper(DAGDeltaAlgorithmImpl &DDAI,
178 const changeset_ty &_Required) 174 const changeset_ty &Required)
179 : DDAI(_DDAI), Required(_Required) {} 175 : DDAI(DDAI), Required(Required) {}
180 }; 176 };
181 177
182 } 178 }
183 179
184 DAGDeltaAlgorithmImpl::DAGDeltaAlgorithmImpl(DAGDeltaAlgorithm &_DDA, 180 DAGDeltaAlgorithmImpl::DAGDeltaAlgorithmImpl(
185 const changeset_ty &_Changes, 181 DAGDeltaAlgorithm &DDA, const changeset_ty &Changes,
186 const std::vector<edge_ty> 182 const std::vector<edge_ty> &Dependencies)
187 &_Dependencies) 183 : DDA(DDA) {
188 : DDA(_DDA),
189 Changes(_Changes),
190 Dependencies(_Dependencies)
191 {
192 for (changeset_ty::const_iterator it = Changes.begin(), 184 for (changeset_ty::const_iterator it = Changes.begin(),
193 ie = Changes.end(); it != ie; ++it) { 185 ie = Changes.end(); it != ie; ++it) {
194 Predecessors.insert(std::make_pair(*it, std::vector<change_ty>())); 186 Predecessors.insert(std::make_pair(*it, std::vector<change_ty>()));
195 Successors.insert(std::make_pair(*it, std::vector<change_ty>())); 187 Successors.insert(std::make_pair(*it, std::vector<change_ty>()));
196 } 188 }