Move getType() and getCaller() into CallSiteBase so that
authorDan Gohman <gohman@apple.com>
Wed, 14 Apr 2010 20:28:44 +0000 (20:28 +0000)
committerDan Gohman <gohman@apple.com>
Wed, 14 Apr 2010 20:28:44 +0000 (20:28 +0000)
ImmutableCallSite can use them too.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101279 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Support/CallSite.h

index c7a438e5498b0dc60c0837f41c446fc29438ac1c..83a472e1b0f942cfa9dd486c43e341480f6573fc 100644 (file)
@@ -175,6 +175,14 @@ private:
     else
       return getInstruction()->op_end() - 3; // Skip BB, BB, Function
   }
+
+  /// getType - Return the type of the instruction that generated this call site
+  ///
+  const Type *getType() const { return (*this)->getType(); }
+
+  /// getCaller - Return the caller function for this call site
+  ///
+  Function *getCaller() const { return (*this)->getParent()->getParent(); }
 };
 
 /// ImmutableCallSite - establish a view to a call site for examination
@@ -246,14 +254,6 @@ public:
   bool doesNotThrow() const;
   void setDoesNotThrow(bool doesNotThrow = true);
 
-  /// getType - Return the type of the instruction that generated this call site
-  ///
-  const Type *getType() const { return (*this)->getType(); }
-
-  /// getCaller - Return the caller function for this call site
-  ///
-  Function *getCaller() const { return (*this)->getParent()->getParent(); }
-
   /// hasArgument - Returns true if this CallSite passes the given Value* as an
   /// argument to the called function.
   bool hasArgument(const Value *Arg) const;