diff options
author | Chris Lattner <sabre@nondot.org> | 2003-09-20 16:34:13 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2003-09-20 16:34:13 +0000 |
commit | 808a7aeec77e79ad236614a578b1bb758ce796ab (patch) | |
tree | 97f4e36e707c16b9b64ffc36c2acd3f1e6796f51 /include/llvm/Analysis/DataStructure/DSSupport.h | |
parent | 192cd9cccd3eb2c030c3a25d636d90b69841868e (diff) |
Switch from using CallInst's to represent call sites to using the LLVM
CallSite class. Now we can represent function calls by invoke instructions
too!
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8629 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Analysis/DataStructure/DSSupport.h')
-rw-r--r-- | include/llvm/Analysis/DataStructure/DSSupport.h | 24 |
1 files changed, 11 insertions, 13 deletions
diff --git a/include/llvm/Analysis/DataStructure/DSSupport.h b/include/llvm/Analysis/DataStructure/DSSupport.h index aff7abcb6e..f80423b0d9 100644 --- a/include/llvm/Analysis/DataStructure/DSSupport.h +++ b/include/llvm/Analysis/DataStructure/DSSupport.h @@ -7,11 +7,9 @@ #ifndef LLVM_ANALYSIS_DSSUPPORT_H #define LLVM_ANALYSIS_DSSUPPORT_H -#include <vector> #include <functional> -#include <string> -#include <cassert> #include "Support/hash_set" +#include "llvm/Support/CallSite.h" class Function; class CallInst; @@ -127,7 +125,7 @@ namespace std { /// the DSNode handles for the function arguments. /// class DSCallSite { - CallInst *Inst; // Actual call site + CallSite Site; // Actual call site Function *CalleeF; // The function called (direct call) DSNodeHandle CalleeN; // The function node called (indirect call) DSNodeHandle RetVal; // Returned value @@ -160,21 +158,21 @@ public: /// Constructor. Note - This ctor destroys the argument vector passed in. On /// exit, the argument vector is empty. /// - DSCallSite(CallInst &inst, const DSNodeHandle &rv, DSNode *Callee, + DSCallSite(CallSite CS, const DSNodeHandle &rv, DSNode *Callee, std::vector<DSNodeHandle> &Args) - : Inst(&inst), CalleeF(0), CalleeN(Callee), RetVal(rv) { + : Site(CS), CalleeF(0), CalleeN(Callee), RetVal(rv) { assert(Callee && "Null callee node specified for call site!"); Args.swap(CallArgs); } - DSCallSite(CallInst &inst, const DSNodeHandle &rv, Function *Callee, + DSCallSite(CallSite CS, const DSNodeHandle &rv, Function *Callee, std::vector<DSNodeHandle> &Args) - : Inst(&inst), CalleeF(Callee), RetVal(rv) { + : Site(CS), CalleeF(Callee), RetVal(rv) { assert(Callee && "Null callee function specified for call site!"); Args.swap(CallArgs); } DSCallSite(const DSCallSite &DSCS) // Simple copy ctor - : Inst(DSCS.Inst), CalleeF(DSCS.CalleeF), CalleeN(DSCS.CalleeN), + : Site(DSCS.Site), CalleeF(DSCS.CalleeF), CalleeN(DSCS.CalleeN), RetVal(DSCS.RetVal), CallArgs(DSCS.CallArgs) {} /// Mapping copy constructor - This constructor takes a preexisting call site @@ -183,7 +181,7 @@ public: /// template<typename MapTy> DSCallSite(const DSCallSite &FromCall, const MapTy &NodeMap) { - Inst = FromCall.Inst; + Site = FromCall.Site; InitNH(RetVal, FromCall.RetVal, NodeMap); InitNH(CalleeN, FromCall.CalleeN, NodeMap); CalleeF = FromCall.CalleeF; @@ -194,7 +192,7 @@ public: } const DSCallSite &operator=(const DSCallSite &RHS) { - Inst = RHS.Inst; + Site = RHS.Site; CalleeF = RHS.CalleeF; CalleeN = RHS.CalleeN; RetVal = RHS.RetVal; @@ -212,7 +210,7 @@ public: // Accessor functions... Function &getCaller() const; - CallInst &getCallInst() const { return *Inst; } + CallSite getCallSite() const { return Site; } DSNodeHandle &getRetVal() { return RetVal; } const DSNodeHandle &getRetVal() const { return RetVal; } @@ -236,7 +234,7 @@ public: void swap(DSCallSite &CS) { if (this != &CS) { - std::swap(Inst, CS.Inst); + std::swap(Site, CS.Site); std::swap(RetVal, CS.RetVal); std::swap(CalleeN, CS.CalleeN); std::swap(CalleeF, CS.CalleeF); |