Reapply r99451 with a fix to move the NoInline check to the cost functions

instead of InlineFunction.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@99483 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Eric Christopher
2010-03-25 04:49:10 +00:00
parent 3d7d07ef03
commit f27e6088a3
5 changed files with 53 additions and 4 deletions
+13 -2
View File
@@ -31,13 +31,13 @@ using namespace llvm;
//===----------------------------------------------------------------------===//
#define CALLSITE_DELEGATE_GETTER(METHOD) \
Instruction *II(getInstruction()); \
Instruction *II = getInstruction(); \
return isCall() \
? cast<CallInst>(II)->METHOD \
: cast<InvokeInst>(II)->METHOD
#define CALLSITE_DELEGATE_SETTER(METHOD) \
Instruction *II(getInstruction()); \
Instruction *II = getInstruction(); \
if (isCall()) \
cast<CallInst>(II)->METHOD; \
else \
@@ -66,6 +66,17 @@ bool CallSite::paramHasAttr(uint16_t i, Attributes attr) const {
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());
}