From c7fe1ab2504692c99bc7625e2e1821debe3c8c3e Mon Sep 17 00:00:00 2001 From: "Duncan P. N. Exon Smith" Date: Sat, 14 Feb 2015 15:36:52 +0000 Subject: [PATCH] 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 --- lib/Target/TargetMachine.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Target/TargetMachine.cpp b/lib/Target/TargetMachine.cpp index c054f5789f0..307e93c37d4 100644 --- a/lib/Target/TargetMachine.cpp +++ b/lib/Target/TargetMachine.cpp @@ -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");