[llvm-commits] CVS: llvm/include/llvm/Analysis/DataStructure/DSGraph.h DSGraphTraits.h DSNode.h DSSupport.h DataStructure.h
Misha Brukman
brukman at cs.uiuc.edu
Thu Apr 21 13:18:16 PDT 2005
Changes in directory llvm/include/llvm/Analysis/DataStructure:
DSGraph.h updated: 1.108 -> 1.109
DSGraphTraits.h updated: 1.23 -> 1.24
DSNode.h updated: 1.53 -> 1.54
DSSupport.h updated: 1.39 -> 1.40
DataStructure.h updated: 1.93 -> 1.94
---
Log message:
Remove trailing whitespace
---
Diffs of the changes: (+55 -55)
DSGraph.h | 20 +++++++++---------
DSGraphTraits.h | 12 +++++-----
DSNode.h | 10 ++++-----
DSSupport.h | 6 ++---
DataStructure.h | 62 ++++++++++++++++++++++++++++----------------------------
5 files changed, 55 insertions(+), 55 deletions(-)
Index: llvm/include/llvm/Analysis/DataStructure/DSGraph.h
diff -u llvm/include/llvm/Analysis/DataStructure/DSGraph.h:1.108 llvm/include/llvm/Analysis/DataStructure/DSGraph.h:1.109
--- llvm/include/llvm/Analysis/DataStructure/DSGraph.h:1.108 Thu Mar 24 17:45:20 2005
+++ llvm/include/llvm/Analysis/DataStructure/DSGraph.h Thu Apr 21 15:18:05 2005
@@ -1,10 +1,10 @@
//===- DSGraph.h - Represent a collection of data structures ----*- C++ -*-===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This header defines the data structure graph (DSGraph) and the
@@ -25,14 +25,14 @@
class GlobalValue;
//===----------------------------------------------------------------------===//
-/// DSScalarMap - An instance of this class is used to keep track of all of
+/// DSScalarMap - An instance of this class is used to keep track of all of
/// which DSNode each scalar in a function points to. This is specialized to
-/// keep track of globals with nodes in the function, and to keep track of the
+/// keep track of globals with nodes in the function, and to keep track of the
/// unique DSNodeHandle being used by the scalar map.
///
-/// This class is crucial to the efficiency of DSA with some large SCC's. In
+/// This class is crucial to the efficiency of DSA with some large SCC's. In
/// these cases, the cost of iterating over the scalar map dominates the cost
-/// of DSA. In all of these cases, the DSA phase is really trying to identify
+/// of DSA. In all of these cases, the DSA phase is really trying to identify
/// globals or unique node handles active in the function.
///
class DSScalarMap {
@@ -48,7 +48,7 @@
EquivalenceClasses<GlobalValue*> &getGlobalECs() const { return GlobalECs; }
- // Compatibility methods: provide an interface compatible with a map of
+ // Compatibility methods: provide an interface compatible with a map of
// Value* to DSNodeHandle's.
typedef ValueMapTy::const_iterator const_iterator;
typedef ValueMapTy::iterator iterator;
@@ -142,11 +142,11 @@
return ValueMap.insert(std::make_pair(V, DSNodeHandle())).first->second;
}
- void erase(iterator I) {
+ void erase(iterator I) {
assert(I != ValueMap.end() && "Cannot erase end!");
if (GlobalValue *GV = dyn_cast<GlobalValue>(I->first))
GlobalSet.erase(GV);
- ValueMap.erase(I);
+ ValueMap.erase(I);
}
void clear() {
@@ -555,7 +555,7 @@
if (CloneFlags & DSGraph::StripIncompleteBit)
BitsToKeep &= ~DSNode::Incomplete;
}
-
+
DSNodeHandle getClonedNH(const DSNodeHandle &SrcNH);
void merge(const DSNodeHandle &NH, const DSNodeHandle &SrcNH);
Index: llvm/include/llvm/Analysis/DataStructure/DSGraphTraits.h
diff -u llvm/include/llvm/Analysis/DataStructure/DSGraphTraits.h:1.23 llvm/include/llvm/Analysis/DataStructure/DSGraphTraits.h:1.24
--- llvm/include/llvm/Analysis/DataStructure/DSGraphTraits.h:1.23 Wed Mar 16 16:42:01 2005
+++ llvm/include/llvm/Analysis/DataStructure/DSGraphTraits.h Thu Apr 21 15:18:05 2005
@@ -1,10 +1,10 @@
//===- DSGraphTraits.h - Provide generic graph interface --------*- C++ -*-===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// This file provides GraphTraits specializations for the DataStructure graph
@@ -28,7 +28,7 @@
friend class DSNode;
NodeTy * const Node;
unsigned Offset;
-
+
typedef DSNodeIterator<NodeTy> _Self;
DSNodeIterator(NodeTy *N) : Node(N), Offset(0) {} // begin iterator
@@ -56,7 +56,7 @@
Offset = I.Offset;
return *this;
}
-
+
pointer operator*() const {
if (Node->isDeadNode())
return Node->getForwardNode();
@@ -64,13 +64,13 @@
return Node->getLink(Offset).getNode();
}
pointer operator->() const { return operator*(); }
-
+
_Self& operator++() { // Preincrement
Offset += (1 << DS::PointerShift);
return *this;
}
_Self operator++(int) { // Postincrement
- _Self tmp = *this; ++*this; return tmp;
+ _Self tmp = *this; ++*this; return tmp;
}
unsigned getOffset() const { return Offset; }
Index: llvm/include/llvm/Analysis/DataStructure/DSNode.h
diff -u llvm/include/llvm/Analysis/DataStructure/DSNode.h:1.53 llvm/include/llvm/Analysis/DataStructure/DSNode.h:1.54
--- llvm/include/llvm/Analysis/DataStructure/DSNode.h:1.53 Sat Mar 19 21:29:39 2005
+++ llvm/include/llvm/Analysis/DataStructure/DSNode.h Thu Apr 21 15:18:05 2005
@@ -1,10 +1,10 @@
//===- DSNode.h - Node definition for datastructure graphs ------*- C++ -*-===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// Data structure graph nodes and some implementation of DSNodeHandle.
@@ -84,7 +84,7 @@
AllocaNode = 1 << 0, // This node was allocated with alloca
HeapNode = 1 << 1, // This node was allocated with malloc
GlobalNode = 1 << 2, // This node was allocated by a global var decl
- UnknownNode = 1 << 3, // This node points to unknown allocated memory
+ UnknownNode = 1 << 3, // This node points to unknown allocated memory
Incomplete = 1 << 4, // This node may not be complete
Modified = 1 << 5, // This node is modified in this context
@@ -97,7 +97,7 @@
Composition = AllocaNode | HeapNode | GlobalNode | UnknownNode,
};
-
+
/// NodeType - A union of the above bits. "Shadow" nodes do not add any flags
/// to the nodes in the data structure graph, so it is possible to have nodes
/// with a value of 0 for their NodeType.
@@ -105,7 +105,7 @@
private:
unsigned short NodeType;
public:
-
+
/// DSNode ctor - Create a node of the specified type, inserting it into the
/// specified graph.
///
Index: llvm/include/llvm/Analysis/DataStructure/DSSupport.h
diff -u llvm/include/llvm/Analysis/DataStructure/DSSupport.h:1.39 llvm/include/llvm/Analysis/DataStructure/DSSupport.h:1.40
--- llvm/include/llvm/Analysis/DataStructure/DSSupport.h:1.39 Mon Mar 21 03:38:39 2005
+++ llvm/include/llvm/Analysis/DataStructure/DSSupport.h Thu Apr 21 15:18:05 2005
@@ -1,10 +1,10 @@
//===- DSSupport.h - Support for datastructure graphs -----------*- C++ -*-===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// Support for graph nodes, call sites, and types.
@@ -161,7 +161,7 @@
/// DSCallSite - Representation of a call site via its call instruction,
/// the DSNode handle for the callee function (or function pointer), and
/// the DSNode handles for the function arguments.
-///
+///
class DSCallSite {
CallSite Site; // Actual call site
Function *CalleeF; // The function called (direct call)
Index: llvm/include/llvm/Analysis/DataStructure/DataStructure.h
diff -u llvm/include/llvm/Analysis/DataStructure/DataStructure.h:1.93 llvm/include/llvm/Analysis/DataStructure/DataStructure.h:1.94
--- llvm/include/llvm/Analysis/DataStructure/DataStructure.h:1.93 Thu Apr 21 11:08:59 2005
+++ llvm/include/llvm/Analysis/DataStructure/DataStructure.h Thu Apr 21 15:18:05 2005
@@ -1,10 +1,10 @@
//===- DataStructure.h - Build data structure graphs ------------*- C++ -*-===//
-//
+//
// The LLVM Compiler Infrastructure
//
// This file was developed by the LLVM research group and is distributed under
// the University of Illinois Open Source License. See LICENSE.TXT for details.
-//
+//
//===----------------------------------------------------------------------===//
//
// Implement the LLVM data structure analysis library.
@@ -82,7 +82,7 @@
/// releaseMemory - if the pass pipeline is done with this pass, we can
/// release our memory...
- ///
+ ///
virtual void releaseMemory();
/// getAnalysisUsage - This obviously provides a data structure graph.
@@ -177,7 +177,7 @@
DSGraph &getOrCreateGraph(Function *F);
unsigned calculateGraphs(Function *F, std::vector<Function*> &Stack,
- unsigned &NextID,
+ unsigned &NextID,
hash_map<Function*, unsigned> &ValMap);
};
@@ -313,7 +313,7 @@
private:
unsigned calculateSCCGraphs(DSGraph &FG, std::vector<DSGraph*> &Stack,
- unsigned &NextID,
+ unsigned &NextID,
hash_map<DSGraph*, unsigned> &ValMap);
DSGraph &getOrCreateGraph(Function &F);
void processGraph(DSGraph &G);
@@ -327,99 +327,99 @@
///
struct EquivClassGraphs : public ModulePass {
CompleteBUDataStructures *CBU;
-
+
DSGraph *GlobalsGraph;
-
+
// DSInfo - one graph for each function.
hash_map<const Function*, DSGraph*> DSInfo;
-
+
/// ActualCallees - The actual functions callable from indirect call sites.
///
std::set<std::pair<Instruction*, Function*> > ActualCallees;
-
+
// Equivalence class where functions that can potentially be called via the
// same function pointer are in the same class.
EquivalenceClasses<Function*> FuncECs;
-
+
/// OneCalledFunction - For each indirect call, we keep track of one
/// target of the call. This is used to find equivalence class called by
/// a call site.
std::map<DSNode*, Function *> OneCalledFunction;
-
+
/// GlobalECs - The equivalence classes for each global value that is merged
/// with other global values in the DSGraphs.
EquivalenceClasses<GlobalValue*> GlobalECs;
-
+
public:
/// EquivClassGraphs - Computes the equivalence classes and then the
/// folded DS graphs for each class.
- ///
+ ///
virtual bool runOnModule(Module &M);
-
+
/// print - Print out the analysis results...
///
void print(std::ostream &O, const Module *M) const;
-
+
EquivalenceClasses<GlobalValue*> &getGlobalECs() { return GlobalECs; }
-
+
/// getDSGraph - Return the data structure graph for the specified function.
/// This returns the folded graph. The folded graph is the same as the CBU
- /// graph iff the function is in a singleton equivalence class AND all its
+ /// graph iff the function is in a singleton equivalence class AND all its
/// callees also have the same folded graph as the CBU graph.
- ///
+ ///
DSGraph &getDSGraph(const Function &F) const {
hash_map<const Function*, DSGraph*>::const_iterator I = DSInfo.find(&F);
assert(I != DSInfo.end() && "No graph computed for that function!");
return *I->second;
}
-
+
bool hasGraph(const Function &F) const {
return DSInfo.find(&F) != DSInfo.end();
}
-
+
/// ContainsDSGraphFor - Return true if we have a graph for the specified
/// function.
bool ContainsDSGraphFor(const Function &F) const {
return DSInfo.find(&F) != DSInfo.end();
}
-
+
/// getSomeCalleeForCallSite - Return any one callee function at
/// a call site.
- ///
+ ///
Function *getSomeCalleeForCallSite(const CallSite &CS) const;
-
+
DSGraph &getGlobalsGraph() const {
return *GlobalsGraph;
}
-
+
typedef std::set<std::pair<Instruction*, Function*> > ActualCalleesTy;
const ActualCalleesTy &getActualCallees() const {
return ActualCallees;
}
-
+
typedef ActualCalleesTy::const_iterator callee_iterator;
callee_iterator callee_begin(Instruction *I) const {
return ActualCallees.lower_bound(std::pair<Instruction*,Function*>(I, 0));
}
-
+
callee_iterator callee_end(Instruction *I) const {
I = (Instruction*)((char*)I + 1);
return ActualCallees.lower_bound(std::pair<Instruction*,Function*>(I, 0));
}
-
+
virtual void getAnalysisUsage(AnalysisUsage &AU) const {
AU.setPreservesAll();
AU.addRequired<CompleteBUDataStructures>();
}
-
+
private:
void buildIndirectFunctionSets(Module &M);
-
+
unsigned processSCC(DSGraph &FG, std::vector<DSGraph*> &Stack,
- unsigned &NextID,
+ unsigned &NextID,
std::map<DSGraph*, unsigned> &ValMap);
void processGraph(DSGraph &FG);
-
+
DSGraph &getOrCreateGraph(Function &F);
};
More information about the llvm-commits
mailing list