buzbee | 311ca16 | 2013-02-28 15:56:43 -0800 | [diff] [blame^] | 1 | /* |
| 2 | * Copyright (C) 2013 The Android Open Source Project |
| 3 | * |
| 4 | * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | * you may not use this file except in compliance with the License. |
| 6 | * You may obtain a copy of the License at |
| 7 | * |
| 8 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | * |
| 10 | * Unless required by applicable law or agreed to in writing, software |
| 11 | * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | * See the License for the specific language governing permissions and |
| 14 | * limitations under the License. |
| 15 | */ |
| 16 | |
| 17 | #ifndef ART_SRC_COMPILER_DEX_DATAFLOW_ITERATOR_H_ |
| 18 | #define ART_SRC_COMPILER_DEX_DATAFLOW_ITERATOR_H_ |
| 19 | |
| 20 | #include "compiler_ir.h" |
| 21 | #include "mir_graph.h" |
| 22 | |
| 23 | namespace art { |
| 24 | |
| 25 | class DataflowIterator { |
| 26 | public: |
| 27 | DataflowIterator(MIRGraph* mir_graph, DataFlowAnalysisMode dfa_mode, bool is_iterative); |
| 28 | ~DataflowIterator(){} |
| 29 | |
| 30 | BasicBlock* Next(bool had_change); |
| 31 | BasicBlock* Next(); |
| 32 | |
| 33 | private: |
| 34 | // TODO: rework this class. |
| 35 | MIRGraph* mir_graph_; |
| 36 | DataFlowAnalysisMode mode_; |
| 37 | bool is_iterative_; |
| 38 | bool changed_; |
| 39 | int start_idx_; |
| 40 | int end_idx_; |
| 41 | int idx_; |
| 42 | bool reverse_; |
| 43 | GrowableList* block_id_list_; |
| 44 | GrowableListIterator all_nodes_iterator_; |
| 45 | |
| 46 | BasicBlock* NextBody(bool had_change); |
| 47 | |
| 48 | }; // DataflowIterator |
| 49 | } // namespace art |
| 50 | |
| 51 | #endif // ART_SRC_COMPILER_DEX_DATAFLOW_ITERATOR_H_ |