Simplify code a bit, add comment flyer

llvm-svn: 4238
This commit is contained in:
Chris Lattner 2002-10-20 22:11:44 +00:00
parent 4eec37a762
commit 9d0418d007

View 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
Function& DSCallSite::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]));
}