From 45bb48ea197fe496865387120c7c55b56f0717d6 Mon Sep 17 00:00:00 2001 From: Tom Stellard Date: Sat, 13 Jun 2015 03:28:10 +0000 Subject: R600 -> AMDGPU rename llvm-svn: 239657 --- llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp | 25 ++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp (limited to 'llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp') diff --git a/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp b/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp new file mode 100644 index 00000000000..21c7da66323 --- /dev/null +++ b/llvm/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp @@ -0,0 +1,25 @@ +#include "AMDGPUMachineFunction.h" +#include "AMDGPU.h" +#include "llvm/IR/Attributes.h" +#include "llvm/IR/Function.h" +using namespace llvm; + +static const char *const ShaderTypeAttribute = "ShaderType"; + +// Pin the vtable to this file. +void AMDGPUMachineFunction::anchor() {} + +AMDGPUMachineFunction::AMDGPUMachineFunction(const MachineFunction &MF) : + MachineFunctionInfo(), + ShaderType(ShaderType::COMPUTE), + LDSSize(0), + ScratchSize(0), + IsKernel(true) { + Attribute A = MF.getFunction()->getFnAttribute(ShaderTypeAttribute); + + if (A.isStringAttribute()) { + StringRef Str = A.getValueAsString(); + if (Str.getAsInteger(0, ShaderType)) + llvm_unreachable("Can't parse shader type!"); + } +} -- cgit v1.2.3