1 //===-- SIMachineFunctionInfo.cpp - SI Machine Function Info -------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
9 //===----------------------------------------------------------------------===//
12 #include "SIMachineFunctionInfo.h"
13 #include "llvm/IR/Attributes.h"
14 #include "llvm/IR/Function.h"
18 const char *SIMachineFunctionInfo::ShaderTypeAttribute = "ShaderType";
20 SIMachineFunctionInfo::SIMachineFunctionInfo(const MachineFunction &MF)
21 : MachineFunctionInfo(),
25 AttributeSet Set = MF.getFunction()->getAttributes();
26 Attribute A = Set.getAttribute(AttributeSet::FunctionIndex,
29 if (A.isStringAttribute()) {
30 StringRef Str = A.getValueAsString();
31 if (Str.getAsInteger(0, ShaderType))
32 llvm_unreachable("Can't parse shader type!");