From: Chris Lattner Date: Mon, 3 Feb 2003 19:11:04 +0000 (+0000) Subject: Eliminate unused resolving caller stuff X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=5a939029d5cf285f2b8714a3cc9e608437fe3ead;p=oota-llvm.git Eliminate unused resolving caller stuff git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@5475 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/include/llvm/Analysis/DSSupport.h b/include/llvm/Analysis/DSSupport.h index 06bcb5eaa9f..96a60c0fc3f 100644 --- a/include/llvm/Analysis/DSSupport.h +++ b/include/llvm/Analysis/DSSupport.h @@ -47,6 +47,7 @@ namespace DS { // FIXME: After the paper, this should get cleaned up class DSNodeHandle { DSNode *N; unsigned Offset; + void operator==(const DSNode *N); // DISALLOW, use to promote N to nodehandle public: // Allow construction, destruction, and assignment... DSNodeHandle(DSNode *n = 0, unsigned offs = 0) : N(0), Offset(offs) { @@ -103,19 +104,12 @@ inline void swap(DSNodeHandle &NH1, DSNodeHandle &NH2) { NH1.swap(NH2); } /// DSCallSite - Representation of a call site via its call instruction, /// the DSNode handle for the callee function (or function pointer), and /// the DSNode handles for the function arguments. -/// -/// One unusual aspect of this callsite record is the ResolvingCaller member. -/// If this is non-null, then it indicates the function that allowed a call-site -/// to finally be resolved. Because of indirect calls, this function may not -/// actually be the function that contains the Call instruction itself. This is -/// used by the BU and TD passes to communicate. /// class DSCallSite { CallInst *Inst; // Actual call site DSNodeHandle RetVal; // Returned value DSNodeHandle Callee; // The function node called std::vector CallArgs; // The pointer arguments - Function *ResolvingCaller; // See comments above static void InitNH(DSNodeHandle &NH, const DSNodeHandle &Src, const hash_map &NodeMap) { @@ -146,14 +140,13 @@ public: /// DSCallSite(CallInst &inst, const DSNodeHandle &rv, const DSNodeHandle &callee, std::vector &Args) - : Inst(&inst), RetVal(rv), Callee(callee), ResolvingCaller(0) { + : Inst(&inst), RetVal(rv), Callee(callee) { Args.swap(CallArgs); } DSCallSite(const DSCallSite &DSCS) // Simple copy ctor : Inst(DSCS.Inst), RetVal(DSCS.RetVal), - Callee(DSCS.Callee), CallArgs(DSCS.CallArgs), - ResolvingCaller(DSCS.ResolvingCaller) {} + Callee(DSCS.Callee), CallArgs(DSCS.CallArgs) {} /// Mapping copy constructor - This constructor takes a preexisting call site /// to copy plus a map that specifies how the links should be transformed. @@ -168,7 +161,6 @@ public: CallArgs.resize(FromCall.CallArgs.size()); for (unsigned i = 0, e = FromCall.CallArgs.size(); i != e; ++i) InitNH(CallArgs[i], FromCall.CallArgs[i], NodeMap); - ResolvingCaller = FromCall.ResolvingCaller; } // Accessor functions... @@ -182,9 +174,6 @@ public: unsigned getNumPtrArgs() const { return CallArgs.size(); } - Function *getResolvingCaller() const { return ResolvingCaller; } - void setResolvingCaller(Function *F) { ResolvingCaller = F; } - DSNodeHandle &getPtrArg(unsigned i) { assert(i < CallArgs.size() && "Argument to getPtrArgNode is out of range!"); return CallArgs[i]; @@ -200,7 +189,6 @@ public: std::swap(RetVal, CS.RetVal); std::swap(Callee, CS.Callee); std::swap(CallArgs, CS.CallArgs); - std::swap(ResolvingCaller, CS.ResolvingCaller); } } diff --git a/include/llvm/Analysis/DataStructure/DSSupport.h b/include/llvm/Analysis/DataStructure/DSSupport.h index 06bcb5eaa9f..96a60c0fc3f 100644 --- a/include/llvm/Analysis/DataStructure/DSSupport.h +++ b/include/llvm/Analysis/DataStructure/DSSupport.h @@ -47,6 +47,7 @@ namespace DS { // FIXME: After the paper, this should get cleaned up class DSNodeHandle { DSNode *N; unsigned Offset; + void operator==(const DSNode *N); // DISALLOW, use to promote N to nodehandle public: // Allow construction, destruction, and assignment... DSNodeHandle(DSNode *n = 0, unsigned offs = 0) : N(0), Offset(offs) { @@ -103,19 +104,12 @@ inline void swap(DSNodeHandle &NH1, DSNodeHandle &NH2) { NH1.swap(NH2); } /// DSCallSite - Representation of a call site via its call instruction, /// the DSNode handle for the callee function (or function pointer), and /// the DSNode handles for the function arguments. -/// -/// One unusual aspect of this callsite record is the ResolvingCaller member. -/// If this is non-null, then it indicates the function that allowed a call-site -/// to finally be resolved. Because of indirect calls, this function may not -/// actually be the function that contains the Call instruction itself. This is -/// used by the BU and TD passes to communicate. /// class DSCallSite { CallInst *Inst; // Actual call site DSNodeHandle RetVal; // Returned value DSNodeHandle Callee; // The function node called std::vector CallArgs; // The pointer arguments - Function *ResolvingCaller; // See comments above static void InitNH(DSNodeHandle &NH, const DSNodeHandle &Src, const hash_map &NodeMap) { @@ -146,14 +140,13 @@ public: /// DSCallSite(CallInst &inst, const DSNodeHandle &rv, const DSNodeHandle &callee, std::vector &Args) - : Inst(&inst), RetVal(rv), Callee(callee), ResolvingCaller(0) { + : Inst(&inst), RetVal(rv), Callee(callee) { Args.swap(CallArgs); } DSCallSite(const DSCallSite &DSCS) // Simple copy ctor : Inst(DSCS.Inst), RetVal(DSCS.RetVal), - Callee(DSCS.Callee), CallArgs(DSCS.CallArgs), - ResolvingCaller(DSCS.ResolvingCaller) {} + Callee(DSCS.Callee), CallArgs(DSCS.CallArgs) {} /// Mapping copy constructor - This constructor takes a preexisting call site /// to copy plus a map that specifies how the links should be transformed. @@ -168,7 +161,6 @@ public: CallArgs.resize(FromCall.CallArgs.size()); for (unsigned i = 0, e = FromCall.CallArgs.size(); i != e; ++i) InitNH(CallArgs[i], FromCall.CallArgs[i], NodeMap); - ResolvingCaller = FromCall.ResolvingCaller; } // Accessor functions... @@ -182,9 +174,6 @@ public: unsigned getNumPtrArgs() const { return CallArgs.size(); } - Function *getResolvingCaller() const { return ResolvingCaller; } - void setResolvingCaller(Function *F) { ResolvingCaller = F; } - DSNodeHandle &getPtrArg(unsigned i) { assert(i < CallArgs.size() && "Argument to getPtrArgNode is out of range!"); return CallArgs[i]; @@ -200,7 +189,6 @@ public: std::swap(RetVal, CS.RetVal); std::swap(Callee, CS.Callee); std::swap(CallArgs, CS.CallArgs); - std::swap(ResolvingCaller, CS.ResolvingCaller); } }