Skip to content

Commit

Permalink
Target: Canonicalize access to function attributes, NFC
Browse files Browse the repository at this point in the history
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
  • Loading branch information
dexonsmith committed Feb 14, 2015
1 parent 8cfbff5 commit c7fe1ab
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/Target/TargetMachine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ TargetMachine::~TargetMachine() {
void TargetMachine::resetTargetOptions(const Function &F) const {
#define RESET_OPTION(X, Y) \
do { \
if (F.hasFnAttribute(Y)) \
Options.X = (F.getAttributes() \
.getAttribute(AttributeSet::FunctionIndex, Y) \
.getValueAsString() == "true"); \
if (F.hasFnAttribute(Y)) \
Options.X = (F.getFnAttribute(Y).getValueAsString() == "true"); \
} while (0)

RESET_OPTION(NoFramePointerElim, "no-frame-pointer-elim");
Expand Down

0 comments on commit c7fe1ab

Please sign in to comment.