R600: Canonicalize access to function attributes, NFC
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sat, 14 Feb 2015 02:45:45 +0000 (02:45 +0000)
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>
Sat, 14 Feb 2015 02:45:45 +0000 (02:45 +0000)
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

lib/Target/R600/AMDGPUMachineFunction.cpp
lib/Target/R600/SITypeRewriter.cpp

index 0f3f9e26528b8e70c57b21beed40874e896a591e..21c7da66323497e692f010275eba070564fb53e2 100644 (file)
@@ -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();
index 9318dc11d55d3972d12b69b993b7defd1878aa0d..27bbf4f850354c81b1baef4630cec5b80b2d38d2 100644 (file)
@@ -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()) {