14#ifndef LLVM_CLANG_AST_HLSLRESOURCE_H
15#define LLVM_CLANG_AST_HLSLRESOURCE_H
23#include "llvm/Frontend/HLSL/HLSLResource.h"
24#include "llvm/Support/raw_ostream.h"
28class HLSLResourceBindingAttr;
29class HLSLRVkBindingAttr;
54 llvm_unreachable(
"no explicit binding");
71 return RegBinding->getImplicitBindingOrderID();
89 return RegBinding->getImplicitCounterBindingOrderID();
95 case llvm::dxil::ResourceDimension::Dim1D:
98 case llvm::dxil::ResourceDimension::Dim2D:
101 case llvm::dxil::ResourceDimension::Dim3D:
102 case llvm::dxil::ResourceDimension::Cube:
105 case llvm::dxil::ResourceDimension::Unknown:
107 "We cannot get the dimension of a resource with unknown dimension.");
109 llvm_unreachable(
"Unhandled llvm::dxil::ResourceDimension enum.");
120 if (
const auto *ResTy =
121 SecondField->
getType()->
getAs<HLSLAttributedResourceType>()) {
122 return ResTy->getAttrs().IsCounter;
135 inline static constexpr std::string_view BaseClassDelim =
"::";
136 inline static constexpr std::string_view FieldDelim =
".";
137 inline static constexpr std::string_view ArrayIndexDelim = FieldDelim;
149 assert(!Offsets.empty() &&
"no name to pop");
150 Name.resize(Offsets.pop_back_val());
158 void pushName(llvm::StringRef N, llvm::StringRef Delim);
Defines the clang::ASTContext interface.
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
const TargetInfo & getTargetInfo() const
Represents a C++ struct/union/class.
Decl - This represents one declaration (or definition), e.g.
ASTContext & getASTContext() const LLVM_READONLY
Represents a member of a struct/union/class.
One of these records is kept for each identifier that is lexed.
IdentifierInfo & get(StringRef Name)
Return the identifier token info for the specified named identifier.
field_iterator field_end() const
field_iterator field_begin() const
const llvm::Triple & getTriple() const
Returns the target triple of the primary target.
const T * getAs() const
Member-template getAs<specific type>'.
void pushName(llvm::StringRef N)
EmbeddedResourceNameBuilder(llvm::StringRef BaseName)
void pushArrayIndex(uint64_t Index)
void pushBaseNameHierarchy(CXXRecordDecl *DerivedRD, CXXRecordDecl *BaseRD)
EmbeddedResourceNameBuilder()
void pushBaseName(llvm::StringRef N)
IdentifierInfo * getNameAsIdentifier(ASTContext &AST) const
Defines the clang::TargetInfo interface.
uint32_t getResourceDimensions(llvm::dxil::ResourceDimension Dim)
bool hasCounterHandle(const CXXRecordDecl *RD)
The JSON file list parser is used to communicate input to InstallAPI.
unsigned getImplicitOrderID() const
void setCounterImplicitOrderID(unsigned Value) const
bool hasCounterImplicitOrderID() const
unsigned getSpace() const
HLSLVkBindingAttr * VkBinding
unsigned getCounterImplicitOrderID() const
ResourceBindingAttrs(const Decl *D)
bool hasImplicitOrderID() const
HLSLResourceBindingAttr * RegBinding
void setImplicitOrderID(unsigned Value) const