From: Duncan P. N. Exon Smith Date: Sat, 14 Feb 2015 02:45:45 +0000 (+0000) Subject: R600: Canonicalize access to function attributes, NFC X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=20d6ad9de25a8170336ba64141cd569484b83035;p=oota-llvm.git R600: 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@229222 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Target/R600/AMDGPUMachineFunction.cpp b/lib/Target/R600/AMDGPUMachineFunction.cpp index 0f3f9e26528..21c7da66323 100644 --- a/lib/Target/R600/AMDGPUMachineFunction.cpp +++ b/lib/Target/R600/AMDGPUMachineFunction.cpp @@ -15,9 +15,7 @@ AMDGPUMachineFunction::AMDGPUMachineFunction(const MachineFunction &MF) : LDSSize(0), ScratchSize(0), IsKernel(true) { - AttributeSet Set = MF.getFunction()->getAttributes(); - Attribute A = Set.getAttribute(AttributeSet::FunctionIndex, - ShaderTypeAttribute); + Attribute A = MF.getFunction()->getFnAttribute(ShaderTypeAttribute); if (A.isStringAttribute()) { StringRef Str = A.getValueAsString(); diff --git a/lib/Target/R600/SITypeRewriter.cpp b/lib/Target/R600/SITypeRewriter.cpp index 9318dc11d55..27bbf4f8503 100644 --- a/lib/Target/R600/SITypeRewriter.cpp +++ b/lib/Target/R600/SITypeRewriter.cpp @@ -61,8 +61,7 @@ bool SITypeRewriter::doInitialization(Module &M) { } bool SITypeRewriter::runOnFunction(Function &F) { - AttributeSet Set = F.getAttributes(); - Attribute A = Set.getAttribute(AttributeSet::FunctionIndex, "ShaderType"); + Attribute A = F.getFnAttribute("ShaderType"); unsigned ShaderType = ShaderType::COMPUTE; if (A.isStringAttribute()) {