OSDN Git Service

Add code to be able to merge two call sites
authorChris Lattner <sabre@nondot.org>
Sun, 10 Nov 2002 23:46:51 +0000 (23:46 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 10 Nov 2002 23:46:51 +0000 (23:46 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4685 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Analysis/DSSupport.h
include/llvm/Analysis/DataStructure/DSSupport.h

index 3a5341f..32aec2c 100644 (file)
@@ -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;
index 3a5341f..32aec2c 100644 (file)
@@ -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;