diff options
author | Chris Lattner <sabre@nondot.org> | 2002-11-10 23:46:51 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-11-10 23:46:51 +0000 |
commit | b0dfcbf584bb6acf6e8adb087c42fbd28ec90b12 (patch) | |
tree | a36aea75e82ff7ea0e5264ae7732ba6f5580ed1a /include | |
parent | 169f8b838b3f3be75d605251ba3bdcc0ad09d795 (diff) | |
download | external_llvm-b0dfcbf584bb6acf6e8adb087c42fbd28ec90b12.zip external_llvm-b0dfcbf584bb6acf6e8adb087c42fbd28ec90b12.tar.gz external_llvm-b0dfcbf584bb6acf6e8adb087c42fbd28ec90b12.tar.bz2 |
Add code to be able to merge two call sites
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4685 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/llvm/Analysis/DSSupport.h | 11 | ||||
-rw-r--r-- | include/llvm/Analysis/DataStructure/DSSupport.h | 11 |
2 files changed, 22 insertions, 0 deletions
diff --git a/include/llvm/Analysis/DSSupport.h b/include/llvm/Analysis/DSSupport.h index 3a5341f..32aec2c 100644 --- a/include/llvm/Analysis/DSSupport.h +++ b/include/llvm/Analysis/DSSupport.h @@ -218,6 +218,17 @@ public: } } + // MergeWith - Merge the return value and parameters of the these two call + // sites. + void mergeWith(DSCallSite &CS) { + getRetVal().mergeWith(CS.getRetVal()); + unsigned MinArgs = getNumPtrArgs(); + if (CS.getNumPtrArgs() < MinArgs) MinArgs = CS.getNumPtrArgs(); + + for (unsigned a = 0; a != MinArgs; ++a) + getPtrArg(a).mergeWith(CS.getPtrArg(a)); + } + bool operator<(const DSCallSite &CS) const { if (Callee < CS.Callee) return true; // This must sort by callee first! if (Callee > CS.Callee) return false; diff --git a/include/llvm/Analysis/DataStructure/DSSupport.h b/include/llvm/Analysis/DataStructure/DSSupport.h index 3a5341f..32aec2c 100644 --- a/include/llvm/Analysis/DataStructure/DSSupport.h +++ b/include/llvm/Analysis/DataStructure/DSSupport.h @@ -218,6 +218,17 @@ public: } } + // MergeWith - Merge the return value and parameters of the these two call + // sites. + void mergeWith(DSCallSite &CS) { + getRetVal().mergeWith(CS.getRetVal()); + unsigned MinArgs = getNumPtrArgs(); + if (CS.getNumPtrArgs() < MinArgs) MinArgs = CS.getNumPtrArgs(); + + for (unsigned a = 0; a != MinArgs; ++a) + getPtrArg(a).mergeWith(CS.getPtrArg(a)); + } + bool operator<(const DSCallSite &CS) const { if (Callee < CS.Callee) return true; // This must sort by callee first! if (Callee > CS.Callee) return false; |