forked from OSchip/llvm-project
parent
ff91940879
commit
9157ec025b
|
@ -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…
Reference in New Issue