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