diff options
author | Chris Lattner <sabre@nondot.org> | 2004-11-18 17:46:57 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-11-18 17:46:57 +0000 |
commit | 721aef6897790abc370cd2eddbefa8d0c0a1f6b3 (patch) | |
tree | 857674fd3f156176443ac774e3948861ed78da11 /include/llvm/Instructions.h | |
parent | 56de0363e3be46cec58415dec3b7afb7a9767e78 (diff) | |
download | external_llvm-721aef6897790abc370cd2eddbefa8d0c0a1f6b3.tar.gz external_llvm-721aef6897790abc370cd2eddbefa8d0c0a1f6b3.tar.bz2 external_llvm-721aef6897790abc370cd2eddbefa8d0c0a1f6b3.zip |
Update comments, now that CPR's are gone, inline the methods
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17957 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/llvm/Instructions.h')
-rw-r--r-- | include/llvm/Instructions.h | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/include/llvm/Instructions.h b/include/llvm/Instructions.h index b52ebd9aca..892feaa2c4 100644 --- a/include/llvm/Instructions.h +++ b/include/llvm/Instructions.h @@ -481,10 +481,12 @@ public: virtual CallInst *clone() const; bool mayWriteToMemory() const { return true; } - // FIXME: These methods should be inline once we eliminate - // ConstantPointerRefs! - const Function *getCalledFunction() const; - Function *getCalledFunction(); + /// getCalledFunction - Return the function being called by this instruction + /// if it is a direct call. If it is a call through a function pointer, + /// return null. + Function *getCalledFunction() const { + return dyn_cast<Function>(Operands[0]); + } // getCalledValue - Get a pointer to a method that is invoked by this inst. inline const Value *getCalledValue() const { return Operands[0]; } @@ -1088,12 +1090,11 @@ public: bool mayWriteToMemory() const { return true; } /// getCalledFunction - Return the function called, or null if this is an - /// indirect function invocation... - /// - /// FIXME: These should be inlined once we get rid of ConstantPointerRefs! + /// indirect function invocation. /// - const Function *getCalledFunction() const; - Function *getCalledFunction(); + Function *getCalledFunction() const { + return dyn_cast<Function>(Operands[0]); + } // getCalledValue - Get a pointer to a function that is invoked by this inst. inline const Value *getCalledValue() const { return Operands[0]; } |