mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-08 13:00:50 +00:00
88524e3f6c
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@178504 91177308-0d34-0410-b5e6-96231b3b80d8
23 lines
639 B
C++
23 lines
639 B
C++
#include "AMDGPUMachineFunction.h"
|
|
#include "llvm/IR/Attributes.h"
|
|
#include "llvm/IR/Function.h"
|
|
|
|
namespace llvm {
|
|
|
|
const char *AMDGPUMachineFunction::ShaderTypeAttribute = "ShaderType";
|
|
|
|
AMDGPUMachineFunction::AMDGPUMachineFunction(const MachineFunction &MF) :
|
|
MachineFunctionInfo() {
|
|
AttributeSet Set = MF.getFunction()->getAttributes();
|
|
Attribute A = Set.getAttribute(AttributeSet::FunctionIndex,
|
|
ShaderTypeAttribute);
|
|
|
|
if (A.isStringAttribute()) {
|
|
StringRef Str = A.getValueAsString();
|
|
if (Str.getAsInteger(0, ShaderType))
|
|
llvm_unreachable("Can't parse shader type!");
|
|
}
|
|
}
|
|
|
|
}
|