From fb9e684f5c3172e08074b7b107d7b037d920a233 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Sat, 28 Jun 2003 21:57:13 +0000 Subject: [PATCH] Add new DSGraph::ScalarMapTy typedef to avoid pulling representation issues into callers of getScalarMap llvm-svn: 6944 --- llvm/include/llvm/Analysis/DSGraph.h | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/llvm/include/llvm/Analysis/DSGraph.h b/llvm/include/llvm/Analysis/DSGraph.h index 9a897b2c97c1..8b79c3458366 100644 --- a/llvm/include/llvm/Analysis/DSGraph.h +++ b/llvm/include/llvm/Analysis/DSGraph.h @@ -12,14 +12,18 @@ //===----------------------------------------------------------------------===// /// DSGraph - The graph that represents a function. /// -class DSGraph { +struct DSGraph { + // Public data-type declarations... + typedef hash_map ScalarMapTy; + +private: Function *Func; // Func - The LLVM function this graph corresponds to DSGraph *GlobalsGraph; // Pointer to the common graph of global objects bool PrintAuxCalls; // Should this graph print the Aux calls vector? DSNodeHandle RetNode; // The node that gets returned... std::vector Nodes; - hash_map ScalarMap; + ScalarMapTy ScalarMap; // FunctionCalls - This vector maintains a single entry for each call // instruction in the current graph. The first entry in the vector is the @@ -80,8 +84,8 @@ public: /// getScalarMap - Get a map that describes what the nodes the scalars in this /// function point to... /// - hash_map &getScalarMap() { return ScalarMap; } - const hash_map &getScalarMap() const {return ScalarMap;} + ScalarMapTy &getScalarMap() { return ScalarMap; } + const ScalarMapTy &getScalarMap() const {return ScalarMap;} /// getFunctionCalls - Return the list of call sites in the original local /// graph... @@ -106,7 +110,7 @@ public: DSNodeHandle &getNodeForValue(Value *V) { return ScalarMap[V]; } const DSNodeHandle &getNodeForValue(Value *V) const { - hash_map::const_iterator I = ScalarMap.find(V); + ScalarMapTy::const_iterator I = ScalarMap.find(V); assert(I != ScalarMap.end() && "Use non-const lookup function if node may not be in the map"); return I->second; @@ -181,8 +185,7 @@ public: // 'StripAllocaBit', Alloca markers are removed from the graph as the graph is // being cloned. // - DSNodeHandle cloneInto(const DSGraph &G, - hash_map &OldValMap, + DSNodeHandle cloneInto(const DSGraph &G, ScalarMapTy &OldValMap, hash_map &OldNodeMap, unsigned CloneFlags = 0);