Target: Canonicalize access to function attributes, NFC

Canonicalize access to function attributes to use the simpler API.

getAttributes().getAttribute(AttributeSet::FunctionIndex, Kind)
  => getFnAttribute(Kind)

getAttributes().hasAttribute(AttributeSet::FunctionIndex, Kind)
  => hasFnAttribute(Kind)

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229261 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan P. N. Exon Smith 2015-02-14 15:36:52 +00:00
parent 8cfbff509e
commit c7fe1ab250

View File

@ -54,10 +54,8 @@ TargetMachine::~TargetMachine() {
void TargetMachine::resetTargetOptions(const Function &F) const { void TargetMachine::resetTargetOptions(const Function &F) const {
#define RESET_OPTION(X, Y) \ #define RESET_OPTION(X, Y) \
do { \ do { \
if (F.hasFnAttribute(Y)) \ if (F.hasFnAttribute(Y)) \
Options.X = (F.getAttributes() \ Options.X = (F.getFnAttribute(Y).getValueAsString() == "true"); \
.getAttribute(AttributeSet::FunctionIndex, Y) \
.getValueAsString() == "true"); \
} while (0) } while (0)
RESET_OPTION(NoFramePointerElim, "no-frame-pointer-elim"); RESET_OPTION(NoFramePointerElim, "no-frame-pointer-elim");