llvm.org GIT mirror llvm / 57593ad
Update for post-commit review comments git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@235038 91177308-0d34-0410-b5e6-96231b3b80d8 Daniel Berlin 5 years ago
2 changed file(s) with 20 addition(s) and 24 deletion(s). Raw diff Collapse all Expand all
208208 // Provide an accessor method to use them in range-based patterns.
209209 template
210210 iterator_range> depth_first(const T& G) {
211 return iterator_range>(df_begin(G), df_end(G));
211 return make_range(df_begin(G), df_end(G));
212212 }
213213
214214 // Provide global definitions of external depth first iterators...
231231 template
232232 iterator_range> depth_first_ext(const T& G,
233233 SetTy &S) {
234 return iterator_range>(df_ext_begin(G, S),
235 df_ext_end(G, S));
234 return make_range(df_ext_begin(G, S), df_ext_end(G, S));
236235 }
237236
238237
258257 // Provide an accessor method to use them in range-based patterns.
259258 template
260259 iterator_range> inverse_depth_first(const T& G) {
261 return iterator_range>(idf_begin(G), idf_end(G));
260 return make_range(idf_begin(G), idf_end(G));
262261 }
263262
264263 // Provide global definitions of external inverse depth first iterators...
283282 template
284283 iterator_range> inverse_depth_first_ext(const T& G,
285284 SetTy &S) {
286 return iterator_range>(idf_ext_begin(G, S),
287 idf_ext_end(G, S));
285 return make_range(idf_ext_begin(G, S), idf_ext_end(G, S));
288286 }
289287
290288 } // End llvm namespace
174174 // Provide global constructors that automatically figure out correct types...
175175 //
176176 template
177 po_iterator po_begin(T G) { return po_iterator::begin(G); }
178 template
179 po_iterator po_end (T G) { return po_iterator::end(G); }
180
181 template iterator_range> post_order(T G) {
182 return iterator_range>(po_begin(G), po_end(G));
177 po_iterator po_begin(const T &G) { return po_iterator::begin(G); }
178 template
179 po_iterator po_end (const T &G) { return po_iterator::end(G); }
180
181 template iterator_range> post_order(const T &G) {
182 return make_range(po_begin(G), po_end(G));
183183 }
184184
185185 // Provide global definitions of external postorder iterators...
200200 }
201201
202202 template
203 iterator_range> post_order_ext(T G, SetType &S) {
204 return iterator_range>(po_ext_begin(G, S),
205 po_ext_end(G, S));
203 iterator_range> post_order_ext(const T &G, SetType &S) {
204 return make_range(po_ext_begin(G, S), po_ext_end(G, S));
206205 }
207206
208207 // Provide global definitions of inverse post order iterators...
215214 };
216215
217216 template
218 ipo_iterator ipo_begin(T G, bool Reverse = false) {
217 ipo_iterator ipo_begin(const T &G, bool Reverse = false) {
219218 return ipo_iterator::begin(G, Reverse);
220219 }
221220
222221 template
223 ipo_iterator ipo_end(T G){
222 ipo_iterator ipo_end(const T &G){
224223 return ipo_iterator::end(G);
225224 }
226225
227226 template
228 iterator_range> inverse_post_order(T G, bool Reverse = false) {
229 return iterator_range>(ipo_begin(G, Reverse), ipo_end(G));
227 iterator_range> inverse_post_order(const T &G, bool Reverse = false) {
228 return make_range(ipo_begin(G, Reverse), ipo_end(G));
230229 }
231230
232231 // Provide global definitions of external inverse postorder iterators...
240239 };
241240
242241 template
243 ipo_ext_iterator ipo_ext_begin(T G, SetType &S) {
242 ipo_ext_iterator ipo_ext_begin(const T &G, SetType &S) {
244243 return ipo_ext_iterator::begin(G, S);
245244 }
246245
247246 template
248 ipo_ext_iterator ipo_ext_end(T G, SetType &S) {
247 ipo_ext_iterator ipo_ext_end(const T &G, SetType &S) {
249248 return ipo_ext_iterator::end(G, S);
250249 }
251250
252251 template
253252 iterator_range>
254 inverse_post_order_ext(T G, SetType &S) {
255 return iterator_range>(ipo_ext_begin(G, S),
256 ipo_ext_end(G, S));
253 inverse_post_order_ext(const T &G, SetType &S) {
254 return make_range(ipo_ext_begin(G, S), ipo_ext_end(G, S));
257255 }
258256
259257 //===--------------------------------------------------------------------===//