mirror of
https://github.com/RPCSX/llvm.git
synced 2024-12-14 23:48:49 +00:00
cc22640c4c
v2: update CMakeLists.txt as well Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Tom Stellard <thomas.stellard@amd.com> git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@176626 91177308-0d34-0410-b5e6-96231b3b80d8
35 lines
1.0 KiB
C++
35 lines
1.0 KiB
C++
//===-- SIMachineFunctionInfo.cpp - SI Machine Function Info -------===//
|
|
//
|
|
// The LLVM Compiler Infrastructure
|
|
//
|
|
// This file is distributed under the University of Illinois Open Source
|
|
// License. See LICENSE.TXT for details.
|
|
//
|
|
/// \file
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
#include "SIMachineFunctionInfo.h"
|
|
#include "llvm/IR/Attributes.h"
|
|
#include "llvm/IR/Function.h"
|
|
|
|
using namespace llvm;
|
|
|
|
const char *SIMachineFunctionInfo::ShaderTypeAttribute = "ShaderType";
|
|
|
|
SIMachineFunctionInfo::SIMachineFunctionInfo(const MachineFunction &MF)
|
|
: MachineFunctionInfo(),
|
|
ShaderType(0),
|
|
PSInputAddr(0) {
|
|
|
|
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!");
|
|
}
|
|
}
|