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"
23extern 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)); }
207 std::map<varID, Lattice*> constVarLattices;
211 std::map<varID, int> varLatticeIndex;
244 const std::map<varID, Lattice*>& constVarLattices,
261 std::set<varID> getAllVars();
267 int getVarIndex(
const varID& var);
277 bool meetUpdate(
Lattice *that);
297 void incorporateVars(
Lattice* that);
320 bool addVar(
const varID& var);
321 bool remVar(
const varID& var);
333 std::string str(std::string indent=
"");
360 const std::map<varID, Lattice*>& constVarLattices,
367 using VarsExprsProductLattice::copy;
370 Lattice* copy()
const override;
397 const std::map<varID, Lattice*>& constVarLattices,
404 using VarsExprsProductLattice::copy;
407 Lattice* copy()
const override;
Apply an analysis A's transfer function at a particular AST node type.
This class represents the concept of a C and C++ case option (used within a switch statement).
This class represents the concept of a do-while statement.
This class represents the concept of a C or C++ statement which contains a expression.
This class represents the notion of an expression. Expressions are derived from SgLocatedNodes,...
This class represents the concept of a for loop.
This class represents the concept of an "if" construct.
This class represents the notion of a declared variable.
This class represents the base class for all IR nodes within Sage III.
This class represents a source project, with a list of SgFile objects and global information about th...
This class represents the concept of a C Assembler statement (untested).
This class represents the concept of a do-while statement.
void remapVars(const std::map< varID, varID > &varNameMap, const Function &newFunc)
*Lattice**/void remapVars(const std::map<varID, varID>& varNameMap, const Function& newFunc,...
A node in the control flow graph.