LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
AMDGPUMachineFunction.cpp
Go to the documentation of this file.
2 #include "AMDGPU.h"
3 #include "llvm/IR/Attributes.h"
4 #include "llvm/IR/Function.h"
5 using namespace llvm;
6 
7 static const char *const ShaderTypeAttribute = "ShaderType";
8 
9 // Pin the vtable to this file.
10 void AMDGPUMachineFunction::anchor() {}
11 
15  LDSSize = 0;
17  Attribute A = Set.getAttribute(AttributeSet::FunctionIndex,
19 
20  if (A.isStringAttribute()) {
21  StringRef Str = A.getValueAsString();
22  if (Str.getAsInteger(0, ShaderType))
23  llvm_unreachable("Can't parse shader type!");
24  }
25 }
AMDGPUMachineFunction(const MachineFunction &MF)
const Function * getFunction() const
#define llvm_unreachable(msg)
This file contains the simple types necessary to represent the attributes associated with functions a...
enable_if_c< std::numeric_limits< T >::is_signed, bool >::type getAsInteger(unsigned Radix, T &Result) const
Definition: StringRef.h:337
unsigned LDSSize
Number of bytes in the LDS that are being used.
AttributeSet getAttributes() const
Return the attribute list for this Function.
Definition: Function.h:170
bool isStringAttribute() const
Return true if the attribute is a string (target-dependent) attribute.
Definition: Attributes.cpp:102
Attribute getAttribute(unsigned Index, Attribute::AttrKind Kind) const
Return the attribute object that exists at the given index.
Definition: Attributes.cpp:847
StringRef getValueAsString() const
Return the attribute's value as a string. This requires the attribute to be a string attribute...
Definition: Attributes.cpp:127
static const char *const ShaderTypeAttribute