1 #include "AMDGPUMachineFunction.h"
3 #include "llvm/IR/Attributes.h"
4 #include "llvm/IR/Function.h"
8 const char *AMDGPUMachineFunction::ShaderTypeAttribute = "ShaderType";
10 AMDGPUMachineFunction::AMDGPUMachineFunction(const MachineFunction &MF) :
11 MachineFunctionInfo() {
12 ShaderType = ShaderType::COMPUTE;
14 AttributeSet Set = MF.getFunction()->getAttributes();
15 Attribute A = Set.getAttribute(AttributeSet::FunctionIndex,
18 if (A.isStringAttribute()) {
19 StringRef Str = A.getValueAsString();
20 if (Str.getAsInteger(0, ShaderType))
21 llvm_unreachable("Can't parse shader type!");