1 #include <featureTests.h>
2 #ifdef ROSE_ENABLE_SOURCE_ANALYSIS
4 #ifndef LIVE_DEAD_VAR_ANALYSIS_H
5 #define LIVE_DEAD_VAR_ANALYSIS_H
7 #include "genericDataflowCommon.h"
8 #include "VirtualCFGIterator.h"
10 #include "CallGraphTraverse.h"
11 #include "analysisCommon.h"
14 #include "latticeFull.h"
15 #include "printAnalysisStates.h"
23 extern int liveDeadAnalysisDebugLevel;
29 std::set<varID> liveVars;
54 void remapVars(
const std::map<varID, varID>& varNameMap,
const Function& newFunc);
61 void incorporateVars(
Lattice* that_arg);
82 bool meetUpdate(
Lattice* that_arg);
92 bool addVar(
const varID& var);
93 bool remVar(
const varID& var);
96 bool isLiveVar(
varID var);
101 std::string str(std::string indent=
"");
121 std::set<SgExpression*> assignedExprs;
123 std::set<varID> assignedVars;
125 std::set<varID> usedVars;
129 friend class LDVAExpressionTransfer;
136 :
IntraDFTransferVisitor(f, n, s, d), indent(
" "), liveLat(dynamic_cast<LiveVarsLattice*>(*(dfInfo.begin()))), modified(
false), fseu(fseu_)
138 if(liveDeadAnalysisDebugLevel>=1) Dbg::dbg << indent <<
"liveLat="<<liveLat->str(indent +
" ")<<std::endl;
140 liveLat->initialize();
172 std::vector<Lattice*>& initLattices, std::vector<NodeFact*>& initFacts);
174 boost::shared_ptr<IntraDFTransferVisitor> getTransferVisitor(
const Function& func,
const DataflowNode& n,
175 NodeState& state,
const std::vector<Lattice*>& dfInfo)
176 {
return boost::shared_ptr<IntraDFTransferVisitor>(
new LiveDeadVarsTransfer(func, n, state, dfInfo, fseu)); }
205 std::map<varID, Lattice*> constVarLattices;
209 std::map<varID, int> varLatticeIndex;
242 const std::map<varID, Lattice*>& constVarLattices,
259 std::set<varID> getAllVars();
265 int getVarIndex(
const varID& var);
275 bool meetUpdate(
Lattice *that);
288 void remapVars(
const std::map<varID, varID>& varNameMap,
const Function& newFunc);
295 void incorporateVars(
Lattice* that);
318 bool addVar(
const varID& var);
319 bool remVar(
const varID& var);
331 std::string str(std::string indent=
"");
358 const std::map<varID, Lattice*>& constVarLattices,
393 const std::map<varID, Lattice*>& constVarLattices,
This class represents the concept of a C or C++ statement which contains a expression.
This class represents the concept of a do-while statement.
This class represents the notion of a declared variable.
This class represents the concept of a C and C++ case option (used within a switch statement)...
This class represents the concept of a C Assembler statement (untested).
This class represents the notion of an expression. Expressions are derived from SgLocatedNodes, since similar to statement, expressions have a concrete location within the user's source code.
Apply an analysis A's transfer function at a particular AST node type.
A node in the control flow graph.
This class represents the base class for all IR nodes within Sage III.
This class represents the concept of a for loop.
This class represents the concept of an "if" construct.
This class represents the concept of a do-while statement.
This class represents a source project, with a list of SgFile objects and global information about th...
void remapVars(const std::map< varID, varID > &varNameMap, const Function &newFunc)
*Lattice**/void remapVars(const std::map& varNameMap, const Function& newFunc...