clang: lib/Sema/SemaHLSL.cpp File Reference (original) (raw)
#include "[clang/Sema/SemaHLSL.h](SemaHLSL%5F8h%5Fsource.html)"#include "[clang/AST/ASTConsumer.h](ASTConsumer%5F8h%5Fsource.html)"#include "[clang/AST/ASTContext.h](ASTContext%5F8h%5Fsource.html)"#include "[clang/AST/Attr.h](AST%5F2Attr%5F8h%5Fsource.html)"#include "clang/AST/Attrs.inc"#include "[clang/AST/Decl.h](Decl%5F8h%5Fsource.html)"#include "[clang/AST/DeclBase.h](DeclBase%5F8h%5Fsource.html)"#include "[clang/AST/DeclCXX.h](DeclCXX%5F8h%5Fsource.html)"#include "[clang/AST/DeclarationName.h](DeclarationName%5F8h%5Fsource.html)"#include "[clang/AST/DynamicRecursiveASTVisitor.h](DynamicRecursiveASTVisitor%5F8h%5Fsource.html)"#include "[clang/AST/Expr.h](Expr%5F8h%5Fsource.html)"#include "[clang/AST/HLSLResource.h](HLSLResource%5F8h%5Fsource.html)"#include "[clang/AST/Type.h](Type%5F8h%5Fsource.html)"#include "[clang/AST/TypeBase.h](TypeBase%5F8h%5Fsource.html)"#include "[clang/AST/TypeLoc.h](TypeLoc%5F8h%5Fsource.html)"#include "[clang/Basic/Builtins.h](Builtins%5F8h%5Fsource.html)"#include "[clang/Basic/DiagnosticSema.h](DiagnosticSema%5F8h%5Fsource.html)"#include "[clang/Basic/IdentifierTable.h](IdentifierTable%5F8h%5Fsource.html)"#include "[clang/Basic/LLVM.h](LLVM%5F8h%5Fsource.html)"#include "[clang/Basic/SourceLocation.h](SourceLocation%5F8h%5Fsource.html)"#include "[clang/Basic/Specifiers.h](Specifiers%5F8h%5Fsource.html)"#include "[clang/Basic/TargetInfo.h](include%5F2clang%5F2Basic%5F2TargetInfo%5F8h%5Fsource.html)"#include "[clang/Sema/Initialization.h](Initialization%5F8h%5Fsource.html)"#include "[clang/Sema/Lookup.h](Sema%5F2Lookup%5F8h%5Fsource.html)"#include "[clang/Sema/ParsedAttr.h](ParsedAttr%5F8h%5Fsource.html)"#include "[clang/Sema/Sema.h](Sema%5F8h%5Fsource.html)"#include "[clang/Sema/Template.h](Template%5F8h%5Fsource.html)"#include "llvm/ADT/ArrayRef.h"#include "llvm/ADT/STLExtras.h"#include "llvm/ADT/SmallVector.h"#include "llvm/ADT/StringExtras.h"#include "llvm/ADT/StringRef.h"#include "llvm/ADT/Twine.h"#include "llvm/Frontend/HLSL/HLSLBinding.h"#include "llvm/Frontend/HLSL/RootSignatureValidations.h"#include "llvm/Support/Casting.h"#include "llvm/Support/DXILABI.h"#include "llvm/Support/ErrorHandling.h"#include "llvm/Support/FormatVariadic.h"#include "llvm/TargetParser/Triple.h"#include <cmath>#include <cstddef>#include <iterator>#include <utility>
Go to the source code of this file.
| Typedefs | |
|---|---|
| using | RegisterType = HLSLResourceBindingAttr::RegisterType |
◆ RegisterType
using RegisterType = HLSLResourceBindingAttr::RegisterType
◆ addImplicitBindingAttrToDecl()
| void addImplicitBindingAttrToDecl ( Sema & S, Decl * D, RegisterType RT, uint32_t ImplicitBindingOrderID ) | static |
|---|
◆ BuildFlattenedTypeList()
◆ calculateLegacyCbufferFieldAlign()
◆ calculateLegacyCbufferSize()
◆ castElement()
◆ castVector()
◆ CheckAllArgsHaveSameType()
◆ CheckAllArgTypesAreCorrect()
◆ CheckAnyScalarOrVector()
◆ CheckArgTypeMatches()
◆ CheckBoolSelect()
◆ CheckExpectedBitWidth()
◆ CheckFloatingOrIntRepresentation()
◆ CheckFloatOrHalfRepresentation()
◆ CheckModifiableLValue()
◆ CheckNoDoubleVectors()
◆ CheckResourceHandle()
| bool CheckResourceHandle ( Sema * S, CallExpr * TheCall, unsigned ArgIndex, llvm::function_ref< bool(const HLSLAttributedResourceType *ResType)> Check = nullptr ) | static |
|---|
◆ CheckScalarOrVector()
◆ CheckUnsignedIntRepresentation()
◆ CheckUnsignedIntVecRepresentation()
◆ CheckVectorSelect()
Definition at line 3045 of file SemaHLSL.cpp.
References clang::Sema::Context, clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::Type::getAs(), clang::Sema::getASTContext(), clang::CallExpr::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::CallExpr::getCallee(), clang::ASTContext::getExtVectorType(), clang::CallExpr::getNumArgs(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Type::isVectorType(), and clang::Expr::setType().
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
◆ CheckWaveActive()
◆ convertToRegisterType()
| bool convertToRegisterType ( StringRef Slot, RegisterType * RT ) | static |
|---|
◆ createFieldForHostLayoutStruct()
Definition at line 458 of file SemaHLSL.cpp.
References clang::AS_public, clang::Sema::Context, clang::FieldDecl::Create(), createHostLayoutStruct(), clang::Type::getAsCXXRecordDecl(), clang::Sema::getASTContext(), clang::ASTContext::getCanonicalTagType(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::CanQual< T >::getTypePtr(), clang::ICIS_NoInit, isInvalidConstantBufferLeafElementType(), and requiresImplicitBufferLayoutStructure().
Referenced by createHostLayoutStruct(), and createHostLayoutStructForBuffer().
◆ createHostLayoutStruct()
Definition at line 490 of file SemaHLSL.cpp.
References clang::Decl::addAttr(), clang::DeclContext::addDecl(), clang::AS_none, clang::CXXRecordDecl::bases_begin(), clang::CXXRecordDecl::completeDefinition(), clang::CXXRecordDecl::Create(), createFieldForHostLayoutStruct(), createHostLayoutStruct(), clang::RecordDecl::field_empty(), clang::RecordDecl::fields(), findRecordDeclInContext(), clang::Sema::getASTContext(), clang::ASTContext::getCanonicalTagType(), clang::Decl::getDeclContext(), getHostLayoutStructName(), clang::CXXRecordDecl::getNumBases(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::Type::getUnqualifiedDesugaredType(), clang::TagDecl::isClass(), requiresImplicitBufferLayoutStructure(), clang::CXXRecordDecl::setBases(), clang::Decl::setImplicit(), and clang::TagDecl::startDefinition().
Referenced by createFieldForHostLayoutStruct(), and createHostLayoutStruct().
◆ createHostLayoutStructForBuffer()
Definition at line 555 of file SemaHLSL.cpp.
References clang::Decl::addAttr(), clang::DeclContext::addDecl(), clang::HLSLBufferDecl::addLayoutStruct(), clang::HLSLBufferDecl::buffer_decls(), clang::CXXRecordDecl::completeDefinition(), clang::CXXRecordDecl::Create(), createFieldForHostLayoutStruct(), clang::QualType::getAddressSpace(), clang::ASTContext::getAddrSpaceQualType(), clang::Sema::getASTContext(), getHostLayoutStructName(), clang::NamedDecl::getIdentifier(), clang::VarDecl::getStorageClass(), clang::ValueDecl::getType(), clang::Type::getUnqualifiedDesugaredType(), clang::hlsl_constant, clang::hlsl_groupshared, clang::SC_Static, clang::Decl::setImplicit(), clang::ValueDecl::setType(), and clang::TagDecl::startDefinition().
Referenced by clang::SemaHLSL::ActOnEndOfTranslationUnit(), and clang::SemaHLSL::ActOnFinishBuffer().
◆ DiagnoseHLSLRegisterAttribute()
◆ DiagnoseLocalRegisterBinding()
Definition at line 2239 of file SemaHLSL.cpp.
References clang::cast(), clang::SemaBase::Diag(), clang::Type::getArrayElementTypeNoTypeQual(), clang::Sema::getASTContext(), clang::Decl::getDeclContext(), clang::Decl::getLocation(), getRegisterType(), clang::ValueDecl::getType(), clang::QualType::getTypePtr(), clang::Decl::hasAttr(), clang::isa(), clang::Type::isArithmeticType(), clang::Type::isArrayType(), clang::Type::isFloatingType(), clang::Type::isIntegralType(), clang::Type::isRecordType(), and clang::Type::isVectorType().
Referenced by DiagnoseHLSLRegisterAttribute().
◆ findRecordDeclInContext()
◆ getHostLayoutStructName()
◆ getRegisterType() [1/2]
| RegisterType getRegisterType ( const HLSLAttributedResourceType * ResTy) | static |
|---|
◆ getRegisterType() [2/2]
◆ getResourceArrayHandleType()
| const HLSLAttributedResourceType * getResourceArrayHandleType ( VarDecl * VD) | static |
|---|
◆ getResourceClass()
◆ getScalarCastKind()
◆ getSpecConstBuiltinId()
◆ handleFloatVectorBinOpConversion()
◆ handleIntegerVectorBinOpConversion()
◆ hasCounterHandle()
◆ IsDefaultBufferConstantDecl()
| bool IsDefaultBufferConstantDecl ( VarDecl * VD) | static |
|---|
◆ isInvalidConstantBufferLeafElementType()
| bool isInvalidConstantBufferLeafElementType ( const Type * Ty) | static |
|---|
Definition at line 365 of file SemaHLSL.cpp.
References clang::cast(), clang::Type::getAsCXXRecordDecl(), clang::Type::getUnqualifiedDesugaredType(), clang::Type::isConstantArrayType(), clang::Type::isHLSLAttributedResourceType(), clang::Type::isHLSLBuiltinIntangibleType(), clang::Type::isHLSLResourceRecord(), clang::Type::isHLSLResourceRecordArray(), and isZeroSizedArray().
Referenced by createFieldForHostLayoutStruct(), IsDefaultBufferConstantDecl(), and requiresImplicitBufferLayoutStructure().
◆ isResourceRecordTypeOrArrayOf()
| bool isResourceRecordTypeOrArrayOf ( VarDecl * VD) | static |
|---|
◆ isValidWaveSizeValue()
◆ isVkPipelineBuiltin()
◆ isZeroSizedArray()
◆ requiresImplicitBufferLayoutStructure()
◆ SetElementTypeAsReturnType()
◆ ValidateMultipleRegisterAnnotations()
| bool ValidateMultipleRegisterAnnotations ( Sema & S, Decl * TheDecl, RegisterType regType ) | static |
|---|