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
00010 namespace risc
00011 {
00012
00013 class Variable;
00014 typedef std::vector<Variable*> VariableVector;
00015
00016 namespace sa
00017 {
00018
00024 void
00025 collect_write_variables(SgExpression *expr, std::vector<SgNode*> &write_var);
00026
00032 void
00033 collect_read_variables( SgExpression *expr, std::vector<SgNode*> &read_var);
00034
00041 void
00042 read_write_analysis(
00043 std::vector<SgExpression*> expressions,
00044 std::set<SgVariableSymbol*> &read_only_var,
00045 std::set<SgVariableSymbol*> &write_only_var,
00046 std::vector<SgNode*> &read_write);
00047
00048 bool
00049 is_member_variable_symbol(SgNode *given_variable,
00050 risc::VariableVector &member_variables);
00051
00052 std::vector<SgNode*>::iterator
00053 delete_if_is_not_member_variable(
00054 std::vector<SgNode*> &given_variables,
00055 VariableVector &member_variables);
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 #endif
00067
00068