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