mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-04-05 17:39:16 +00:00
Did I mention that I _HATE_ CPRs?
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@9639 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
94082397d2
commit
bc539434c5
@ -58,9 +58,8 @@ public:
|
||||
/// getCalledFunction - Return the function being called if this is a direct
|
||||
/// call, otherwise return null (if it's an indirect call).
|
||||
///
|
||||
Function *getCalledFunction() const {
|
||||
return dyn_cast<Function>(getCalledValue());
|
||||
}
|
||||
/// FIXME: This should be inlined once ConstantPointerRefs are gone. :(
|
||||
Function *getCalledFunction() const;
|
||||
|
||||
/// setCalledFunction - Set the callee to the specified value...
|
||||
///
|
||||
|
@ -143,3 +143,15 @@ Function *InvokeInst::getCalledFunction() {
|
||||
return cast<Function>(CPR->getValue());
|
||||
return 0;
|
||||
}
|
||||
|
||||
#include "llvm/Support/CallSite.h"
|
||||
|
||||
Function *CallSite::getCalledFunction() const {
|
||||
Value *Callee = getCalledValue();
|
||||
if (Function *F = dyn_cast<Function>(Callee))
|
||||
return F;
|
||||
if (ConstantPointerRef *CPR = dyn_cast<ConstantPointerRef>(Callee))
|
||||
return cast<Function>(CPR->getValue());
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user