introduce a useful abstraction to find out if a Use is in the call position of an instruction

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@62788 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/IPO/ArgumentPromotion.cpp b/lib/Transforms/IPO/ArgumentPromotion.cpp
index 69e427e..183e1a1 100644
--- a/lib/Transforms/IPO/ArgumentPromotion.cpp
+++ b/lib/Transforms/IPO/ArgumentPromotion.cpp
@@ -135,7 +135,7 @@
 
     // Ensure that this call site is CALLING the function, not passing it as
     // an argument.
-    if (UI.getOperandNo() != 0)
+    if (!CS.isCallee(UI))
       return false;
   }