diff options
author | Tom Stellard <thomas.stellard@amd.com> | 2015-06-13 03:28:10 +0000 |
---|---|---|
committer | Tom Stellard <thomas.stellard@amd.com> | 2015-06-13 03:28:10 +0000 |
commit | 953c6814730951ad9a286d7991e9c8c481433d45 (patch) | |
tree | 18ceb605903abc4d40e124137fe5d2d3744c44af /lib/Target/AMDGPU/AMDGPUMachineFunction.cpp | |
parent | 8b8b72ef03c3c7f28ab9f38c462e95046e7a677a (diff) |
R600 -> AMDGPU rename
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@239657 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/AMDGPU/AMDGPUMachineFunction.cpp')
-rw-r--r-- | lib/Target/AMDGPU/AMDGPUMachineFunction.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp b/lib/Target/AMDGPU/AMDGPUMachineFunction.cpp new file mode 100644 index 00000000000..21c7da66323 --- /dev/null +++ b/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!"); + } +} |