diff options
author | Chris Lattner <sabre@nondot.org> | 2005-03-20 02:38:39 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-03-20 02:38:39 +0000 |
commit | a4c1b5f3e60e31a0acf9312a5f27060d7f5259b0 (patch) | |
tree | a1f5bb070cdcc92ea784cb7716749d73271fe642 | |
parent | 1cee779cec967261a80e134e562bac6b8121de34 (diff) |
rename some methods and add some new methods for dealing with the globals list
in a DSNode.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20701 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | include/llvm/Analysis/DataStructure/DSNode.h | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/include/llvm/Analysis/DataStructure/DSNode.h b/include/llvm/Analysis/DataStructure/DSNode.h index beff5e4061..53865da846 100644 --- a/include/llvm/Analysis/DataStructure/DSNode.h +++ b/include/llvm/Analysis/DataStructure/DSNode.h @@ -285,11 +285,28 @@ public: void addGlobal(GlobalValue *GV); void mergeGlobals(const std::vector<GlobalValue*> &RHS); void clearGlobals() { std::vector<GlobalValue*>().swap(Globals); } - const std::vector<GlobalValue*> &getGlobals() const { return Globals; } - typedef std::vector<GlobalValue*>::const_iterator global_iterator; - global_iterator global_begin() const { return Globals.begin(); } - global_iterator global_end() const { return Globals.end(); } + /// getGlobalsList - Return the set of global leaders that are represented by + /// this node. Note that globals that are in this equivalence class but are + /// not leaders are not returned: for that, use addFullGlobalsList(). + const std::vector<GlobalValue*> &getGlobalsList() const { return Globals; } + + /// addFullGlobalsList - Compute the full set of global values that are + /// represented by this node. Unlike getGlobalsList(), this requires fair + /// amount of work to compute, so don't treat this method call as free. + void addFullGlobalsList(std::vector<GlobalValue*> &List) const; + + /// addFullFunctionList - Identical to addFullGlobalsList, but only return the + /// functions in the full list. + void addFullFunctionList(std::vector<Function*> &List) const; + + /// globals_iterator/begin/end - Provide iteration methods over the global + /// value leaders set that is merged into this node. Like the getGlobalsList + /// method, these iterators do not return globals that are part of the + /// equivalence classes for globals in this node, but aren't leaders. + typedef std::vector<GlobalValue*>::const_iterator globals_iterator; + globals_iterator globals_begin() const { return Globals.begin(); } + globals_iterator globals_end() const { return Globals.end(); } /// maskNodeTypes - Apply a mask to the node types bitfield. |