Simplify code a bit, add comment flyer
authorChris Lattner <sabre@nondot.org>
Sun, 20 Oct 2002 22:11:44 +0000 (22:11 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 20 Oct 2002 22:11:44 +0000 (22:11 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4238 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/DataStructure.cpp

index 356736289c000ffb3e1d8617bbc7324d58f19d8a..cf18d57dd20d53d79ed3e7c56e16813fb19b3ee2 100644 (file)
@@ -6,7 +6,6 @@
 
 #include "llvm/Analysis/DSGraph.h"
 #include "llvm/Function.h"
-#include "llvm/BasicBlock.h"
 #include "llvm/iOther.h"
 #include "llvm/DerivedTypes.h"
 #include "llvm/Target/TargetData.h"
@@ -353,21 +352,23 @@ void DSNode::mergeWith(const DSNodeHandle &NH, unsigned Offset) {
   }
 }
 
+//===----------------------------------------------------------------------===//
+// DSCallSite Implementation
+//===----------------------------------------------------------------------===//
+
 // Define here to avoid including iOther.h and BasicBlock.h in DSGraph.h
-FunctionDSCallSite::getCaller() const {
-  return * callInst->getParent()->getParent();
+Function &DSCallSite::getCaller() const {
+  return *callInst->getParent()->getParent();
 }
 
-template<typename _CopierFunction>
-DSCallSite::DSCallSite(const DSCallSite& FromCall,
-                       _CopierFunction nodeCopier)
-  : std::vector<DSNodeHandle>(),
-    callInst(&FromCall.getCallInst()) {
+template <typename CopyFunctor>
+DSCallSite::DSCallSite(const DSCallSite &FromCall, CopyFunctor nodeCopier)
+  : callInst(&FromCall.getCallInst()) {
 
   reserve(FromCall.size());
   for (unsigned j = 0, ej = FromCall.size(); j != ej; ++j)
-    push_back((&nodeCopier == (_CopierFunction*) 0)? DSNodeHandle(FromCall[j])
-                                                   : nodeCopier(&FromCall[j]));
+    push_back(&nodeCopier == 0 ? DSNodeHandle(FromCall[j])
+                               : nodeCopier(&FromCall[j]));
 }