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;
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,