00001 #ifndef READ_WRITE_ANALYSIS_H_INCLUDED_
00002 #define READ_WRITE_ANALYSIS_H_INCLUDED_
00003
00004 #include <rose.h>
00005
00006 #include <vector>
00007 #include <cassert>
00008
00009 #include "../internal_representation/variable.h"
00010
00011 namespace risc
00012 {
00013
00014 namespace sa
00015 {
00016
00022 void
00023 collect_write_variables(SgExpression *expr, std::vector<SgNode*> &write_var);
00024
00030 void
00031 collect_read_variables( SgExpression *expr, std::vector<SgNode*> &read_var);
00032
00039 void
00040 read_write_analysis(
00041 std::vector<SgExpression*> expressions,
00042 std::set<SgVariableSymbol*> &read_only_var,
00043 std::set<SgVariableSymbol*> &write_only_var,
00044 std::vector<SgNode*> &read_write);
00045
00046 bool
00047 is_member_variable_symbol(SgNode *given_variable,
00048 risc::VariableVector &member_variables);
00049
00050 std::vector<SgNode*>::iterator
00051 delete_if_is_not_member_variable(
00052 std::vector<SgNode*> &given_variables,
00053 VariableVector &member_variables);
00054
00055
00056
00057 std::set<SgVariableSymbol*>::iterator
00058 delete_if_is_not_member_symbol(
00059 std::set<SgVariableSymbol*> &given_variables,
00060 VariableVector &member_variables);
00061
00062
00063
00064
00065 }
00066
00067 }
00068
00069 #endif
00070
00071