From a2c5c2b23ad9c0414694c07d368c40a5e483f092 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Thu, 17 Oct 2002 04:22:16 +0000 Subject: [PATCH] * Remove a lot of obsolete #if 0'd code * Add a simple getNodeForValue method to access the ValueMap. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4211 91177308-0d34-0410-b5e6-96231b3b80d8 --- include/llvm/Analysis/DSGraph.h | 50 ++----------------- include/llvm/Analysis/DataStructure/DSGraph.h | 50 ++----------------- 2 files changed, 10 insertions(+), 90 deletions(-) diff --git a/include/llvm/Analysis/DSGraph.h b/include/llvm/Analysis/DSGraph.h index 4995b11bdd3..fce442ebc5f 100644 --- a/include/llvm/Analysis/DSGraph.h +++ b/include/llvm/Analysis/DSGraph.h @@ -347,37 +347,6 @@ class DSGraph { // std::vector > FunctionCalls; -#if 0 - // OrigFunctionCalls - This vector retains a copy of the original function - // calls of the current graph. This is needed to support top-down inlining - // after bottom-up inlining is complete, since the latter deletes call nodes. - // - std::vector > OrigFunctionCalls; - - // PendingCallers - This vector records all unresolved callers of the - // current function, i.e., ones whose graphs have not been inlined into - // the current graph. As long as there are unresolved callers, the nodes - // for formal arguments in the current graph cannot be eliminated, and - // nodes in the graph reachable from the formal argument nodes or - // global variable nodes must be considered incomplete. - std::set PendingCallers; -#endif - -protected: - -#if 0 - // clone all the call nodes and save the copies in OrigFunctionCalls - void saveOrigFunctionCalls() { - assert(OrigFunctionCalls.size() == 0 && "Do this only once!"); - OrigFunctionCalls = FunctionCalls; - } - - // get the saved copies of the original function call nodes - std::vector > &getOrigFunctionCalls() { - return OrigFunctionCalls; - } -#endif - void operator=(const DSGraph &); // DO NOT IMPLEMENT public: DSGraph() : Func(0) {} // Create a new, empty, DSGraph. @@ -410,6 +379,11 @@ public: return FunctionCalls; } + /// getNodeForValue - Given a value that is used or defined in the body of the + /// current function, return the DSNode that it points to. + /// + DSNodeHandle &getNodeForValue(Value *V) { return ValueMap[V]; } + const DSNodeHandle &getRetNode() const { return RetNode; } DSNodeHandle &getRetNode() { return RetNode; } @@ -452,20 +426,6 @@ public: // void removeDeadNodes(bool KeepAllGlobals = false, bool KeepCalls = true); -#if 0 - // AddCaller - add a known caller node into the graph and mark it pending. - // getCallers - get a vector of the functions that call this one - // getCallersPending - get a matching vector of bools indicating if each - // caller's DSGraph has been resolved into this one. - // - void addCaller(Function &caller) { - PendingCallers.insert(&caller); - } - std::set &getPendingCallers() { - return PendingCallers; - } -#endif - // cloneInto - Clone the specified DSGraph into the current graph, returning // the Return node of the graph. The translated ValueMap for the old function // is filled into the OldValMap member. diff --git a/include/llvm/Analysis/DataStructure/DSGraph.h b/include/llvm/Analysis/DataStructure/DSGraph.h index 4995b11bdd3..fce442ebc5f 100644 --- a/include/llvm/Analysis/DataStructure/DSGraph.h +++ b/include/llvm/Analysis/DataStructure/DSGraph.h @@ -347,37 +347,6 @@ class DSGraph { // std::vector > FunctionCalls; -#if 0 - // OrigFunctionCalls - This vector retains a copy of the original function - // calls of the current graph. This is needed to support top-down inlining - // after bottom-up inlining is complete, since the latter deletes call nodes. - // - std::vector > OrigFunctionCalls; - - // PendingCallers - This vector records all unresolved callers of the - // current function, i.e., ones whose graphs have not been inlined into - // the current graph. As long as there are unresolved callers, the nodes - // for formal arguments in the current graph cannot be eliminated, and - // nodes in the graph reachable from the formal argument nodes or - // global variable nodes must be considered incomplete. - std::set PendingCallers; -#endif - -protected: - -#if 0 - // clone all the call nodes and save the copies in OrigFunctionCalls - void saveOrigFunctionCalls() { - assert(OrigFunctionCalls.size() == 0 && "Do this only once!"); - OrigFunctionCalls = FunctionCalls; - } - - // get the saved copies of the original function call nodes - std::vector > &getOrigFunctionCalls() { - return OrigFunctionCalls; - } -#endif - void operator=(const DSGraph &); // DO NOT IMPLEMENT public: DSGraph() : Func(0) {} // Create a new, empty, DSGraph. @@ -410,6 +379,11 @@ public: return FunctionCalls; } + /// getNodeForValue - Given a value that is used or defined in the body of the + /// current function, return the DSNode that it points to. + /// + DSNodeHandle &getNodeForValue(Value *V) { return ValueMap[V]; } + const DSNodeHandle &getRetNode() const { return RetNode; } DSNodeHandle &getRetNode() { return RetNode; } @@ -452,20 +426,6 @@ public: // void removeDeadNodes(bool KeepAllGlobals = false, bool KeepCalls = true); -#if 0 - // AddCaller - add a known caller node into the graph and mark it pending. - // getCallers - get a vector of the functions that call this one - // getCallersPending - get a matching vector of bools indicating if each - // caller's DSGraph has been resolved into this one. - // - void addCaller(Function &caller) { - PendingCallers.insert(&caller); - } - std::set &getPendingCallers() { - return PendingCallers; - } -#endif - // cloneInto - Clone the specified DSGraph into the current graph, returning // the Return node of the graph. The translated ValueMap for the old function // is filled into the OldValMap member. -- 2.34.1