Try r84890 again (adding ValueMap<>), now that I've tested the compile on
[oota-llvm.git] / include / llvm / Support / CallSite.h
index 544c7d7761b1489f9034c111b55d310464458d0f..285b558afccbae1f4acd669e1250cf2dfd803b63 100644 (file)
@@ -26,6 +26,7 @@
 #include "llvm/Attributes.h"
 #include "llvm/ADT/PointerIntPair.h"
 #include "llvm/BasicBlock.h"
+#include "llvm/CallingConv.h"
 #include "llvm/Instruction.h"
 
 namespace llvm {
@@ -40,14 +41,10 @@ public:
   CallSite(CallInst *CI) : I(reinterpret_cast<Instruction*>(CI), true) {}
   CallSite(InvokeInst *II) : I(reinterpret_cast<Instruction*>(II), false) {}
   CallSite(Instruction *C);
-  CallSite(const CallSite &CS) : I(CS.I) {}
-  CallSite &operator=(const CallSite &CS) { I = CS.I; return *this; }
-
-  bool operator==(const CallSite &CS) const { return getInstruction()
-                                                == CS.getInstruction(); }
-  bool operator!=(const CallSite &CS) const { return getInstruction()
-                                                != CS.getInstruction(); }
-  
+
+  bool operator==(const CallSite &CS) const { return I == CS.I; }
+  bool operator!=(const CallSite &CS) const { return I != CS.I; }
+
   /// CallSite::get - This static method is sort of like a constructor.  It will
   /// create an appropriate call site for a Call or Invoke instruction, but it
   /// can also create a null initialized CallSite object for something which is
@@ -65,8 +62,8 @@ public:
 
   /// getCallingConv/setCallingConv - get or set the calling convention of the
   /// call.
-  unsigned getCallingConv() const;
-  void setCallingConv(unsigned CC);
+  CallingConv::ID getCallingConv() const;
+  void setCallingConv(CallingConv::ID CC);
 
   /// getAttributes/setAttributes - get or set the parameter attributes of
   /// the call.
@@ -170,7 +167,7 @@ public:
   /// list for a call site.
   arg_iterator arg_begin() const {
     assert(getInstruction() && "Not a call or invoke instruction!");
-               // Skip non-arguments
+    // Skip non-arguments
     return getInstruction()->op_begin() + getArgumentOffset();
   }
 
@@ -182,6 +179,10 @@ public:
     return getInstruction() < CS.getInstruction();
   }
 
+  bool isCallee(Value::use_iterator UI) const {
+    return getInstruction()->op_begin() == &UI.getUse();
+  }
+
 private:
   /// Returns the operand number of the first argument
   unsigned getArgumentOffset() const {