blob: 0223ec8e4f3f0bd071a9f05c66f148e3c1291864 [file] [log] [blame]
Vincent Lejeune88524e32013-04-01 21:47:53 +00001#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}