[llvm] r229222 - R600: Canonicalize access to function attributes, NFC
Duncan P. N. Exon Smith
dexonsmith at apple.com
Fri Feb 13 18:45:45 PST 2015
Author: dexonsmith
Date: Fri Feb 13 20:45:45 2015
New Revision: 229222
URL: http://llvm.org/viewvc/llvm-project?rev=229222&view=rev
Log:
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)
Modified:
llvm/trunk/lib/Target/R600/AMDGPUMachineFunction.cpp
llvm/trunk/lib/Target/R600/SITypeRewriter.cpp
Modified: llvm/trunk/lib/Target/R600/AMDGPUMachineFunction.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/AMDGPUMachineFunction.cpp?rev=229222&r1=229221&r2=229222&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/AMDGPUMachineFunction.cpp (original)
+++ llvm/trunk/lib/Target/R600/AMDGPUMachineFunction.cpp Fri Feb 13 20:45:45 2015
@@ -15,9 +15,7 @@ AMDGPUMachineFunction::AMDGPUMachineFunc
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();
Modified: llvm/trunk/lib/Target/R600/SITypeRewriter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/R600/SITypeRewriter.cpp?rev=229222&r1=229221&r2=229222&view=diff
==============================================================================
--- llvm/trunk/lib/Target/R600/SITypeRewriter.cpp (original)
+++ llvm/trunk/lib/Target/R600/SITypeRewriter.cpp Fri Feb 13 20:45:45 2015
@@ -61,8 +61,7 @@ bool SITypeRewriter::doInitialization(Mo
}
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()) {
More information about the llvm-commits
mailing list