[llvm-commits] CVS: llvm-poolalloc/lib/Macroscopic/StructureFieldVisitor.cpp StructureFieldVisitor.h
Misha Brukman
brukman at cs.uiuc.edu
Sat Apr 23 13:37:09 PDT 2005
Changes in directory llvm-poolalloc/lib/Macroscopic:
StructureFieldVisitor.cpp updated: 1.1 -> 1.2
StructureFieldVisitor.h updated: 1.1 -> 1.2
---
Log message:
* Fix spelling of "Visitor" in file comment
* Doxygenify comments
---
Diffs of the changes: (+15 -1)
StructureFieldVisitor.cpp | 13 ++++++++++++-
StructureFieldVisitor.h | 3 +++
2 files changed, 15 insertions(+), 1 deletion(-)
Index: llvm-poolalloc/lib/Macroscopic/StructureFieldVisitor.cpp
diff -u llvm-poolalloc/lib/Macroscopic/StructureFieldVisitor.cpp:1.1 llvm-poolalloc/lib/Macroscopic/StructureFieldVisitor.cpp:1.2
--- llvm-poolalloc/lib/Macroscopic/StructureFieldVisitor.cpp:1.1 Sat Apr 23 15:29:22 2005
+++ llvm-poolalloc/lib/Macroscopic/StructureFieldVisitor.cpp Sat Apr 23 15:36:58 2005
@@ -1,4 +1,4 @@
-//===-- StructureFieldVisitation.cpp - Implement StructureFieldVisitor ----===//
+//===-- StructureFieldVisitor.cpp - Implement StructureFieldVisitor -------===//
//
// The LLVM Compiler Infrastructure
//
@@ -35,6 +35,7 @@
}
/// getFieldOffset - Return the offset of this field from the start of the node.
+///
unsigned LatticeValue::getFieldOffset() const {
const TargetData &TD = getNode()->getParentGraph()->getTargetData();
@@ -94,6 +95,7 @@
namespace {
/// SFVInstVisitor - This visitor is used to do the actual visitation of
/// memory instructions in the program.
+ ///
struct SFVInstVisitor : public InstVisitor<SFVInstVisitor, bool> {
DSGraph &DSG;
const unsigned Callbacks;
@@ -208,6 +210,7 @@
/// RemoveLatticeValueAtBottom - When analysis determines that LV hit bottom,
/// this method is used to remove it from the NodeLVs map. This method always
/// returns true to simplify caller code.
+///
bool SFVInstVisitor::RemoveLatticeValueAtBottom(LatticeValue *LV) {
for (std::multimap<DSNode*, LatticeValue*>::iterator I
= NodeLVs.find(LV->getNode());; ++I) {
@@ -297,6 +300,7 @@
/// VisitGlobalInit - The specified lattice value corresponds to a field (or
/// several) in the specified global. Merge all of the overlapping initializer
/// values into LV (up-to and until it becomes overdefined).
+///
static bool VisitGlobalInit(LatticeValue *LV, Constant *Init,
unsigned FieldOffset) {
const TargetData &TD = LV->getParentGraph().getTargetData();
@@ -347,6 +351,7 @@
/// visitFields - Visit all uses of the specified fields, updating the lattice
/// values as appropriate.
+///
void StructureFieldVisitorBase::visitFields(std::set<LatticeValue*> &Fields) {
// Now that we added all of the initial nodes, find out what graphs these
// nodes are rooted in. For efficiency, handle batches of nodes in the same
@@ -424,6 +429,7 @@
/// ComputeInverseGraphFrom - Perform a simple depth-first search of the
/// DSGraph, recording the inverse of all of the edges in the graph.
+///
static void ComputeInverseGraphFrom(DSNode *N,
std::set<std::pair<DSNode*,DSNode*> > &InverseGraph) {
for (DSNode::edge_iterator I = N->edge_begin(), E = N->edge_end(); I != E;++I)
@@ -436,6 +442,7 @@
/// ComputeNodesReacahbleFrom - Compute the set of nodes in the specified
/// inverse graph that are reachable from N. This is a simple depth first
/// search.
+///
static void ComputeNodesReachableFrom(DSNode *N,
std::set<std::pair<DSNode*,DSNode*> > &InverseGraph,
hash_set<const DSNode*> &Reachable) {
@@ -451,6 +458,7 @@
/// reachable from globals, we have to make sure that we incorporate data for
/// all graphs that include those globals due to the nature of the globals
/// graph.
+///
void StructureFieldVisitorBase::
ProcessNodesReachableFromGlobals(DSGraph &DSG,
std::multimap<DSNode*,LatticeValue*> &NodeLVs){
@@ -638,6 +646,7 @@
/// getCalleeFacts - Compute the data flow effect that calling one of the
/// functions in this graph has on the caller. This information is cached after
/// it is computed for a function the first time.
+///
std::multimap<DSNode*, LatticeValue*> &
StructureFieldVisitorBase::getCalleeFacts(DSGraph &DSG) {
// Already computed?
@@ -669,6 +678,7 @@
/// VisitFlags events. This is used to reduce the cost of interprocedural
/// analysis by not traversing the call graph through portions that the DSGraph
/// can answer immediately.
+///
static bool NodeCanPossiblyBeInteresting(const DSNode *N, unsigned VisitFlags) {
// No fields are accessed in this context.
if (N->getType() == Type::VoidTy) return false;
@@ -687,6 +697,7 @@
/// visitGraph - Visit the functions in the specified graph, updating the
/// specified lattice values for all of their uses.
+///
void StructureFieldVisitorBase::
visitGraph(DSGraph &DSG, std::multimap<DSNode*, LatticeValue*> &NodeLVs) {
assert(!NodeLVs.empty() && "No lattice values to compute!");
Index: llvm-poolalloc/lib/Macroscopic/StructureFieldVisitor.h
diff -u llvm-poolalloc/lib/Macroscopic/StructureFieldVisitor.h:1.1 llvm-poolalloc/lib/Macroscopic/StructureFieldVisitor.h:1.2
--- llvm-poolalloc/lib/Macroscopic/StructureFieldVisitor.h:1.1 Sat Apr 23 15:29:22 2005
+++ llvm-poolalloc/lib/Macroscopic/StructureFieldVisitor.h Sat Apr 23 15:36:58 2005
@@ -66,6 +66,7 @@
/// getFieldOffset - Get the byte offset of this field from the start of the
/// node.
+ ///
unsigned getFieldOffset() const;
/// dump - Print debugging information about this class.
@@ -76,6 +77,7 @@
/// guaranteed to be the same dynamic type as 'this') into this lattice value.
/// If the resultant value hits bottom, return true. This is used for
/// interprocedural analysis.
+ ///
virtual bool mergeInValue(const LatticeValue *RHS) {
return true;
}
@@ -92,6 +94,7 @@
/// visitRecognizedCall - The node for this lattice value is passed into some
/// external function that is "known" by the Local analysis pass (e.g. atoi).
/// By default, this stops any analysis of the node.
+ ///
virtual bool visitRecognizedCall(Instruction &I) {
return true;
}
More information about the llvm-commits
mailing list