diff options
author | Dan Gohman <gohman@apple.com> | 2010-04-14 21:47:32 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2010-04-14 21:47:32 +0000 |
commit | 7a3dff329f92f79689301c0a59af795a8842d030 (patch) | |
tree | eac358542f1015584fc38ab41e9f2121597e8cf9 /llvm/lib | |
parent | 76378270645e3db0d909641d5915bdd43a10f342 (diff) | |
download | bcm5719-llvm-7a3dff329f92f79689301c0a59af795a8842d030.tar.gz bcm5719-llvm-7a3dff329f92f79689301c0a59af795a8842d030.zip |
Move a bunch of methods from CallSite to CallSiteBase, so that they can
be used in ImmutableCallSite too.
llvm-svn: 101292
Diffstat (limited to 'llvm/lib')
-rw-r--r-- | llvm/lib/VMCore/Instructions.cpp | 77 |
1 files changed, 0 insertions, 77 deletions
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp index 65786dffed5..d5c89c98634 100644 --- a/llvm/lib/VMCore/Instructions.cpp +++ b/llvm/lib/VMCore/Instructions.cpp @@ -30,80 +30,6 @@ using namespace llvm; // CallSite Class //===----------------------------------------------------------------------===// -#define CALLSITE_DELEGATE_GETTER(METHOD) \ - Instruction *II = getInstruction(); \ - return isCall() \ - ? cast<CallInst>(II)->METHOD \ - : cast<InvokeInst>(II)->METHOD - -#define CALLSITE_DELEGATE_SETTER(METHOD) \ - Instruction *II = getInstruction(); \ - if (isCall()) \ - cast<CallInst>(II)->METHOD; \ - else \ - cast<InvokeInst>(II)->METHOD - -CallingConv::ID CallSite::getCallingConv() const { - CALLSITE_DELEGATE_GETTER(getCallingConv()); -} -void CallSite::setCallingConv(CallingConv::ID CC) { - CALLSITE_DELEGATE_SETTER(setCallingConv(CC)); -} -const AttrListPtr &CallSite::getAttributes() const { - CALLSITE_DELEGATE_GETTER(getAttributes()); -} -void CallSite::setAttributes(const AttrListPtr &PAL) { - CALLSITE_DELEGATE_SETTER(setAttributes(PAL)); -} -bool CallSite::paramHasAttr(uint16_t i, Attributes attr) const { - CALLSITE_DELEGATE_GETTER(paramHasAttr(i, attr)); -} -uint16_t CallSite::getParamAlignment(uint16_t i) const { - CALLSITE_DELEGATE_GETTER(getParamAlignment(i)); -} - -/// @brief Return true if the call should not be inlined. -bool CallSite::isNoInline() const { - CALLSITE_DELEGATE_GETTER(isNoInline()); -} - -void CallSite::setIsNoInline(bool Value) { - CALLSITE_DELEGATE_GETTER(setIsNoInline(Value)); -} - - -bool CallSite::doesNotAccessMemory() const { - CALLSITE_DELEGATE_GETTER(doesNotAccessMemory()); -} -void CallSite::setDoesNotAccessMemory(bool doesNotAccessMemory) { - CALLSITE_DELEGATE_SETTER(setDoesNotAccessMemory(doesNotAccessMemory)); -} -bool CallSite::onlyReadsMemory() const { - CALLSITE_DELEGATE_GETTER(onlyReadsMemory()); -} -void CallSite::setOnlyReadsMemory(bool onlyReadsMemory) { - CALLSITE_DELEGATE_SETTER(setOnlyReadsMemory(onlyReadsMemory)); -} -bool CallSite::doesNotReturn() const { - CALLSITE_DELEGATE_GETTER(doesNotReturn()); -} -void CallSite::setDoesNotReturn(bool doesNotReturn) { - CALLSITE_DELEGATE_SETTER(setDoesNotReturn(doesNotReturn)); -} -bool CallSite::doesNotThrow() const { - CALLSITE_DELEGATE_GETTER(doesNotThrow()); -} -void CallSite::setDoesNotThrow(bool doesNotThrow) { - CALLSITE_DELEGATE_SETTER(setDoesNotThrow(doesNotThrow)); -} - -bool CallSite::hasArgument(const Value *Arg) const { - for (arg_iterator AI = this->arg_begin(), E = this->arg_end(); AI != E; ++AI) - if (AI->get() == Arg) - return true; - return false; -} - User::op_iterator CallSite::getCallee() const { Instruction *II(getInstruction()); return isCall() @@ -111,9 +37,6 @@ User::op_iterator CallSite::getCallee() const { : cast<InvokeInst>(II)->op_end() - 3; // Skip BB, BB, Function } -#undef CALLSITE_DELEGATE_GETTER -#undef CALLSITE_DELEGATE_SETTER - //===----------------------------------------------------------------------===// // TerminatorInst Class //===----------------------------------------------------------------------===// |