All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
read_write_analysis.h
Go to the documentation of this file.
1 #ifndef READ_WRITE_ANALYSIS_H_INCLUDED_
2 #define READ_WRITE_ANALYSIS_H_INCLUDED_
3 
4 #include "rose.h"
5 
6 #include <vector>
7 #include <cassert>
8 
9 
10 namespace risc
11 {
12 
13 class Variable;
14 typedef std::vector<Variable*> VariableVector;
15 
16 namespace sa
17 {
18 
24 void
25 collect_write_variables(SgExpression *expr, std::vector<SgNode*> &write_var);
26 
32 void
33 collect_read_variables( SgExpression *expr, std::vector<SgNode*> &read_var);
34 
45 void
47  std::vector<SgExpression*> expressions,
48  std::set<SgVariableSymbol*> &read_only_var,
49  std::set<SgVariableSymbol*> &write_only_var,
50  std::vector<SgNode*> &read_write);
51 
52 bool
53 is_member_variable_symbol(SgNode *given_variable,
54  risc::VariableVector &member_variables);
55 
56 std::vector<SgNode*>::iterator
58  std::vector<SgNode*> &given_variables,
59  VariableVector &member_variables);
60 
61 std::set<SgVariableSymbol*>::iterator
63  std::set<SgVariableSymbol*> &given_variables,
64  VariableVector &member_variables);
65 
66 } // end namesapce sa
67 
68 } // end namespace risc
69 
70 #endif /* READ_WRITE_ANALYSIS_H_INCLUDED_ */
71 
72 /* ex: set softtabstop=2 tabstop=2 shiftwidth=2 expandtab: */
void collect_read_variables(SgExpression *expr, std::vector< SgNode * > &read_var)
This function collects all read variables in the given expression and adds them to the given vector...
Definition: read_write_analysis.cpp:143
bool is_member_variable_symbol(SgNode *given_variable, risc::VariableVector &member_variables)
Definition: read_write_analysis.cpp:422
std::set< SgVariableSymbol * >::iterator delete_if_is_not_member_symbol(std::set< SgVariableSymbol * > &given_variables, VariableVector &member_variables)
Definition: read_write_analysis.cpp:485
std::vector< Variable * > VariableVector
Definition: class.h:46
void read_write_analysis(std::vector< SgExpression * > expressions, std::set< SgVariableSymbol * > &read_only_var, std::set< SgVariableSymbol * > &write_only_var, std::vector< SgNode * > &read_write)
This function collects all read only, write only, and read/write variables in the given expression ve...
Definition: read_write_analysis.cpp:323
void collect_write_variables(SgExpression *expr, std::vector< SgNode * > &write_var)
This function collects all written variables in the given expression and adds them to the given vecto...
Definition: read_write_analysis.cpp:9
std::vector< SgNode * >::iterator delete_if_is_not_member_variable(std::vector< SgNode * > &given_variables, VariableVector &member_variables)
Definition: read_write_analysis.cpp:465