GSAFullRangeDict.hGo to the documentation of this file.00001 #ifndef _GSA_FULL_RANGE_DICT_H
00002 #define _GSA_FULL_RANGE_DICT_H
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041 #ifdef POLARIS_GNU_PRAGMAS
00042 #pragma interface
00043 #endif
00044
00045 #include "../Collection/Map.h"
00046 #include "../Collection/RefMap.h"
00047 #include "../Collection/Database.h"
00048 #include "../Symbol/Symbol.h"
00049 #include "../Expression/Expression.h"
00050 #include "../Statement/Statement.h"
00051 #include "../Array.h"
00052 #include "../String.h"
00053 #include "../IntElem.h"
00054
00055 #include "RangeDict.h"
00056 #include "GSAControlRangeDict.h"
00057 #include "GSAFullRangeData.h"
00058 #include "ExprSet.h"
00059
00060 class IntSet;
00061
00062 class GSAFullRangeDict : public RangeDict {
00063 friend class GSAFullRangeData;
00064 public:
00065 GSAFullRangeDict(ProgramUnit &pgm, int debug = 0);
00066 virtual ~GSAFullRangeDict();
00067
00068 void touch();
00069
00070
00071
00072 void control_touch();
00073
00074
00075
00076
00077 void data_touch();
00078
00079
00080
00081
00082
00083 void clear();
00084
00085
00086 void clear_ranges();
00087
00088
00089
00090
00091 GSAControlRangeDict &control_range_dict();
00092
00093
00094 int num_data_ranges() const;
00095
00096
00097
00098 int num_poisoned_ranges() const;
00099
00100
00101
00102 virtual void print(ostream & o) const;
00103
00104
00105
00106
00107 virtual void pretty_print(ostream & o, const Statement &stmt) const;
00108
00109
00110
00111 virtual Listable *listable_clone(void) const;
00112 virtual int structures_OK() const;
00113
00114
00115 protected:
00116 virtual void _set_range(const Symbol &var, const Statement &stmt,
00117 Expression *range);
00118
00119
00120 virtual void _del_range(const Symbol &var, const Statement &stmt);
00121
00122
00123 virtual const Expression *_get_range_ref(const Symbol &var,
00124 const Statement &stmt);
00125
00126
00127
00128 private:
00129 ProgramUnit *_pgm_ref;
00130 Database<String, IntElem> *_stmt_toporder;
00131
00132 ExprSet _range_values;
00133 Map<Statement, RefMap<Symbol, Expression> > _pgm_ranges;
00134
00135
00136 GSAControlRangeDict _control_ranges;
00137
00138 Map<Symbol, Expression> _data_ranges;
00139
00140 ExprSet _poisoned_ranges;
00141
00142
00143
00144
00145 Map<Symbol, GSAFullRangeData> _pending_ranges;
00146
00147 int _timestamp;
00148
00149 int _num_poisoned_ranges;
00150
00151
00152 const Expression &_ins_data_range(const Symbol &var, Expression *range);
00153 void _order_args(GSAFullRangeData &data) const;
00154 GSAFullRangeData *_create_data(const Statement &stmt, int &df_num,
00155 RefList<GSAFullRangeData> &scc_node_stack);
00156 void _mark_data_as_computed(GSAFullRangeData &data);
00157 void _commit_data(GSAFullRangeData &data);
00158 void _delete_data(GSAFullRangeData &data);
00159 GSARangeOrData _probe_data_ranges(const Symbol &var, int &df_num,
00160 RefList<GSAFullRangeData> &scc_node_stack);
00161 void _calc_iter_order1(GSAFullRangeData &data,
00162 RefList<GSAFullRangeData> &iter_order_list);
00163 Array<GSAFullRangeData *> *_calc_iter_order(GSAFullRangeData &root_node);
00164 void _iterate_to_fixed_point_phase(const Array<GSAFullRangeData *> &toporder_to_stmt,
00165 const IntSet &start_stmts,
00166 bool widening_phase);
00167 void _iterate_to_fixed_point(GSAFullRangeData &root_node);
00168 const Expression *_get_data_range_ref(const Symbol &var,
00169 bool &is_poisoned);
00170 };
00171
00172 #endif
|