1249259Sdim#include "AMDGPUMachineFunction.h" 2251662Sdim#include "AMDGPU.h" 3249259Sdim#include "llvm/IR/Attributes.h" 4249259Sdim#include "llvm/IR/Function.h" 5263508Sdimusing namespace llvm; 6249259Sdim 7263508Sdimstatic const char *const ShaderTypeAttribute = "ShaderType"; 8249259Sdim 9263508Sdim// Pin the vtable to this file. 10263508Sdimvoid AMDGPUMachineFunction::anchor() {} 11249259Sdim 12249259SdimAMDGPUMachineFunction::AMDGPUMachineFunction(const MachineFunction &MF) : 13249259Sdim MachineFunctionInfo() { 14251662Sdim ShaderType = ShaderType::COMPUTE; 15263508Sdim LDSSize = 0; 16249259Sdim AttributeSet Set = MF.getFunction()->getAttributes(); 17249259Sdim Attribute A = Set.getAttribute(AttributeSet::FunctionIndex, 18249259Sdim ShaderTypeAttribute); 19249259Sdim 20249259Sdim if (A.isStringAttribute()) { 21249259Sdim StringRef Str = A.getValueAsString(); 22249259Sdim if (Str.getAsInteger(0, ShaderType)) 23249259Sdim llvm_unreachable("Can't parse shader type!"); 24249259Sdim } 25249259Sdim} 26