aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib
diff options
context:
space:
mode:
authorDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-02-14 02:45:45 +0000
committerDuncan P. N. Exon Smith <dexonsmith@apple.com>2015-02-14 02:45:45 +0000
commit8480c87ce6a7ca543ece1d583a598294e049498c (patch)
treed88aff71d3d04ef1324b011f2d6148ee59c9e8a7 /llvm/lib
parent2e7531435236b836395ace040a83ff501290e764 (diff)
downloadllvm-8480c87ce6a7ca543ece1d583a598294e049498c.zip
llvm-8480c87ce6a7ca543ece1d583a598294e049498c.tar.gz
llvm-8480c87ce6a7ca543ece1d583a598294e049498c.tar.bz2
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) llvm-svn: 229222
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/R600/AMDGPUMachineFunction.cpp4
-rw-r--r--llvm/lib/Target/R600/SITypeRewriter.cpp3
2 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/Target/R600/AMDGPUMachineFunction.cpp b/llvm/lib/Target/R600/AMDGPUMachineFunction.cpp
index 0f3f9e2..21c7da6 100644
--- a/llvm/lib/Target/R600/AMDGPUMachineFunction.cpp
+++ b/llvm/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/llvm/lib/Target/R600/SITypeRewriter.cpp b/llvm/lib/Target/R600/SITypeRewriter.cpp
index 9318dc1..27bbf4f 100644
--- a/llvm/lib/Target/R600/SITypeRewriter.cpp
+++ b/llvm/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()) {