diff options
author | Misha Brukman <brukman+llvm@gmail.com> | 2005-04-21 20:19:05 +0000 |
---|---|---|
committer | Misha Brukman <brukman+llvm@gmail.com> | 2005-04-21 20:19:05 +0000 |
commit | 9769ab22265b313171d201b5928688524a01bd87 (patch) | |
tree | 4215db61d3b617687d0eec4ed3caf7dbf973f4ca /include/llvm/Analysis/DataStructure | |
parent | 109026290b3b07152322e65801edb51dccfe7ddc (diff) | |
download | external_llvm-9769ab22265b313171d201b5928688524a01bd87.tar.gz external_llvm-9769ab22265b313171d201b5928688524a01bd87.tar.bz2 external_llvm-9769ab22265b313171d201b5928688524a01bd87.zip |
Remove trailing whitespace
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21408 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/DataStructure')
-rw-r--r-- | include/llvm/Analysis/DataStructure/DSGraph.h | 20 | ||||
-rw-r--r-- | include/llvm/Analysis/DataStructure/DSGraphTraits.h | 12 | ||||
-rw-r--r-- | include/llvm/Analysis/DataStructure/DSNode.h | 10 | ||||
-rw-r--r-- | include/llvm/Analysis/DataStructure/DSSupport.h | 6 | ||||
-rw-r--r-- | include/llvm/Analysis/DataStructure/DataStructure.h | 62 |
5 files changed, 55 insertions, 55 deletions
diff --git a/include/llvm/Analysis/DataStructure/DSGraph.h b/include/llvm/Analysis/DataStructure/DSGraph.h index 430a7bf281..f38b59eb06 100644 --- a/include/llvm/Analysis/DataStructure/DSGraph.h +++ b/include/llvm/Analysis/DataStructure/DSGraph.h @@ -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 @@ namespace llvm { 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 @@ public: 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 @@ public: 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 @@ public: if (CloneFlags & DSGraph::StripIncompleteBit) BitsToKeep &= ~DSNode::Incomplete; } - + DSNodeHandle getClonedNH(const DSNodeHandle &SrcNH); void merge(const DSNodeHandle &NH, const DSNodeHandle &SrcNH); diff --git a/include/llvm/Analysis/DataStructure/DSGraphTraits.h b/include/llvm/Analysis/DataStructure/DSGraphTraits.h index 5f8b8d0ade..6febf34625 100644 --- a/include/llvm/Analysis/DataStructure/DSGraphTraits.h +++ b/include/llvm/Analysis/DataStructure/DSGraphTraits.h @@ -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 @@ class DSNodeIterator : public forward_iterator<const DSNode, ptrdiff_t> { 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 @@ public: Offset = I.Offset; return *this; } - + pointer operator*() const { if (Node->isDeadNode()) return Node->getForwardNode(); @@ -64,13 +64,13 @@ public: 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; } diff --git a/include/llvm/Analysis/DataStructure/DSNode.h b/include/llvm/Analysis/DataStructure/DSNode.h index 10394ddd06..7ae167efdb 100644 --- a/include/llvm/Analysis/DataStructure/DSNode.h +++ b/include/llvm/Analysis/DataStructure/DSNode.h @@ -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 @@ public: 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 @@ public: 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 @@ public: private: unsigned short NodeType; public: - + /// DSNode ctor - Create a node of the specified type, inserting it into the /// specified graph. /// diff --git a/include/llvm/Analysis/DataStructure/DSSupport.h b/include/llvm/Analysis/DataStructure/DSSupport.h index e4eb21bc23..2fc52db25f 100644 --- a/include/llvm/Analysis/DataStructure/DSSupport.h +++ b/include/llvm/Analysis/DataStructure/DSSupport.h @@ -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 @@ namespace llvm { /// 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) diff --git a/include/llvm/Analysis/DataStructure/DataStructure.h b/include/llvm/Analysis/DataStructure/DataStructure.h index 32299473f4..e110d581db 100644 --- a/include/llvm/Analysis/DataStructure/DataStructure.h +++ b/include/llvm/Analysis/DataStructure/DataStructure.h @@ -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 @@ public: /// 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 @@ private: 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 @@ struct CompleteBUDataStructures : public BUDataStructures { 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 @@ private: /// 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); }; |