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;
53 llvm_unreachable(
"no explicit binding");
70 return RegBinding->getImplicitBindingOrderID();
88 return RegBinding->getImplicitCounterBindingOrderID();
94 case llvm::dxil::ResourceDimension::Dim1D:
97 case llvm::dxil::ResourceDimension::Dim2D:
100 case llvm::dxil::ResourceDimension::Dim3D:
101 case llvm::dxil::ResourceDimension::Cube:
104 case llvm::dxil::ResourceDimension::Unknown:
106 "We cannot get the dimension of a resource with unknown dimension.");
108 llvm_unreachable(
"Unhandled llvm::dxil::ResourceDimension enum.");
114 return Dim != llvm::dxil::ResourceDimension::Cube;
125 if (
const auto *ResTy =
126 SecondField->
getType()->
getAs<HLSLAttributedResourceType>()) {
127 return ResTy->getAttrs().IsCounter;
140 inline static constexpr std::string_view BaseClassDelim =
"::";
141 inline static constexpr std::string_view FieldDelim =
".";
142 inline static constexpr std::string_view ArrayIndexDelim = FieldDelim;
154 assert(!Offsets.empty() &&
"no name to pop");
155 Name.resize(Offsets.pop_back_val());
162 llvm::StringRef
getName()
const {
return Name; }
165 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)
llvm::StringRef getName() const
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 hasResourceOffset(llvm::dxil::ResourceDimension Dim)
bool hasCounterHandle(const CXXRecordDecl *RD)
Top level wrappers for InstallAPI frontend operations.
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