summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Analysis/DataStructure/DataStructure.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2002-10-21 15:04:18 +0000
committerChris Lattner <sabre@nondot.org>2002-10-21 15:04:18 +0000
commit78c1e7d83c9bee035a86b0b54508684bbc278dca (patch)
tree64e96d5ff03dabcbbaf1242202b4d756c8fc27bc /llvm/lib/Analysis/DataStructure/DataStructure.cpp
parent32438d8c84233c82c7467f01b4b90c1cc641cf7e (diff)
downloadbcm5719-llvm-78c1e7d83c9bee035a86b0b54508684bbc278dca.tar.gz
bcm5719-llvm-78c1e7d83c9bee035a86b0b54508684bbc278dca.zip
As it turns out, we don't need a fully generic mapping copy ctor, we just need
something that maps through a std::map. Since this simplified the client and implementation code, do so now. llvm-svn: 4250
Diffstat (limited to 'llvm/lib/Analysis/DataStructure/DataStructure.cpp')
-rw-r--r--llvm/lib/Analysis/DataStructure/DataStructure.cpp20
1 files changed, 1 insertions, 19 deletions
diff --git a/llvm/lib/Analysis/DataStructure/DataStructure.cpp b/llvm/lib/Analysis/DataStructure/DataStructure.cpp
index d40be448113..cc0b8d8fc5a 100644
--- a/llvm/lib/Analysis/DataStructure/DataStructure.cpp
+++ b/llvm/lib/Analysis/DataStructure/DataStructure.cpp
@@ -361,18 +361,6 @@ Function &DSCallSite::getCaller() const {
return *Inst->getParent()->getParent();
}
-template <typename CopyFunctor>
-DSCallSite::DSCallSite(const DSCallSite &FromCall, CopyFunctor nodeCopier)
- : Inst(FromCall.Inst) {
-
- RetVal = nodeCopier(&FromCall.RetVal);
- Callee = nodeCopier(&FromCall.Callee);
-
- CallArgs.reserve(FromCall.CallArgs.size());
- for (unsigned j = 0, ej = FromCall.CallArgs.size(); j != ej; ++j)
- CallArgs.push_back(nodeCopier(&FromCall.CallArgs[j]));
-}
-
//===----------------------------------------------------------------------===//
// DSGraph Implementation
@@ -402,11 +390,6 @@ DSGraph::~DSGraph() {
void DSGraph::dump() const { print(std::cerr); }
-static DSNodeHandle copyHelper(const DSNodeHandle* fromNode,
- std::map<const DSNode*, DSNode*> *NodeMap) {
- return DSNodeHandle((*NodeMap)[fromNode->getNode()], fromNode->getOffset());
-}
-
// Helper function used to clone a function list.
//
static void CopyFunctionCallsList(const vector<DSCallSite>& fromCalls,
@@ -415,8 +398,7 @@ static void CopyFunctionCallsList(const vector<DSCallSite>& fromCalls,
unsigned FC = toCalls.size(); // FirstCall
toCalls.reserve(FC+fromCalls.size());
for (unsigned i = 0, ei = fromCalls.size(); i != ei; ++i)
- toCalls.push_back(DSCallSite(fromCalls[i],
- std::bind2nd(std::ptr_fun(&copyHelper), &NodeMap)));
+ toCalls.push_back(DSCallSite(fromCalls[i], NodeMap));
}
/// remapLinks - Change all of the Links in the current node according to the
OpenPOWER on IntegriCloud