|
clang 22.0.0git
|
#include "clang/Sema/SemaHLSL.h"#include "clang/AST/ASTConsumer.h"#include "clang/AST/ASTContext.h"#include "clang/AST/Attr.h"#include "clang/AST/Attrs.inc"#include "clang/AST/Decl.h"#include "clang/AST/DeclBase.h"#include "clang/AST/DeclCXX.h"#include "clang/AST/DeclarationName.h"#include "clang/AST/DynamicRecursiveASTVisitor.h"#include "clang/AST/Expr.h"#include "clang/AST/HLSLResource.h"#include "clang/AST/Type.h"#include "clang/AST/TypeBase.h"#include "clang/AST/TypeLoc.h"#include "clang/Basic/Builtins.h"#include "clang/Basic/DiagnosticSema.h"#include "clang/Basic/IdentifierTable.h"#include "clang/Basic/LLVM.h"#include "clang/Basic/SourceLocation.h"#include "clang/Basic/Specifiers.h"#include "clang/Basic/TargetInfo.h"#include "clang/Sema/Initialization.h"#include "clang/Sema/Lookup.h"#include "clang/Sema/ParsedAttr.h"#include "clang/Sema/Sema.h"#include "clang/Sema/Template.h"#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 |
| using RegisterType = HLSLResourceBindingAttr::RegisterType |
Definition at line 58 of file SemaHLSL.cpp.
|
static |
Definition at line 586 of file SemaHLSL.cpp.
References clang::Decl::addAttr(), and clang::Sema::getASTContext().
Referenced by clang::SemaHLSL::ActOnEndOfTranslationUnit(), clang::SemaHLSL::ActOnFinishBuffer(), and clang::SemaHLSL::ActOnVariableDeclarator().
|
static |
Definition at line 3412 of file SemaHLSL.cpp.
References BuildFlattenedTypeList(), clang::RecordDecl::fields(), clang::ValueDecl::getType(), clang::TagDecl::isUnion(), and clang::T.
Referenced by BuildFlattenedTypeList(), clang::SemaHLSL::CanPerformAggregateSplatCast(), clang::SemaHLSL::CanPerformElementwiseCast(), and clang::SemaHLSL::IsScalarizedLayoutCompatible().
|
static |
Definition at line 220 of file SemaHLSL.cpp.
References calculateLegacyCbufferFieldAlign(), and clang::T.
Referenced by calculateLegacyCbufferFieldAlign(), and calculateLegacyCbufferSize().
|
static |
Definition at line 239 of file SemaHLSL.cpp.
References calculateLegacyCbufferFieldAlign(), calculateLegacyCbufferSize(), and clang::T.
Referenced by calculateLegacyCbufferSize(), and validatePackoffset().
|
static |
Definition at line 978 of file SemaHLSL.cpp.
References clang::ActionResult< PtrTy, Compress >::get(), and clang::Sema::ImpCastExprToType().
Referenced by handleFloatVectorBinOpConversion(), and handleIntegerVectorBinOpConversion().
|
static |
Definition at line 970 of file SemaHLSL.cpp.
References clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::Sema::getASTContext(), clang::ASTContext::getExtVectorType(), and clang::Sema::ImpCastExprToType().
Referenced by clang::SemaHLSL::handleVectorBinOpConversion().
Definition at line 2693 of file SemaHLSL.cpp.
References clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::Sema::getASTContext(), clang::CallExpr::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::CallExpr::getDirectCallee(), clang::Stmt::getEndLoc(), clang::CallExpr::getNumArgs(), clang::Expr::getType(), and clang::ASTContext::hasSameUnqualifiedType().
|
static |
Definition at line 2720 of file SemaHLSL.cpp.
References clang::CallExpr::getArg(), clang::Stmt::getBeginLoc(), clang::CallExpr::getNumArgs(), and clang::Expr::getType().
Definition at line 2832 of file SemaHLSL.cpp.
References clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::CallExpr::getNumArgs(), and clang::Expr::getType().
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
Definition at line 2710 of file SemaHLSL.cpp.
References clang::SemaBase::Diag(), clang::Sema::getASTContext(), clang::Stmt::getBeginLoc(), clang::Expr::getType(), and clang::ASTContext::hasSameUnqualifiedType().
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
Definition at line 2865 of file SemaHLSL.cpp.
References clang::Sema::Context, clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::CallExpr::getBeginLoc(), clang::CallExpr::getNumArgs(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ASTContext::hasSameUnqualifiedType(), and clang::Expr::setType().
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
|
static |
Definition at line 2771 of file SemaHLSL.cpp.
References clang::SemaBase::Diag(), clang::Type::hasFloatingRepresentation(), and clang::Type::hasIntegerRepresentation().
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
|
static |
Definition at line 2733 of file SemaHLSL.cpp.
References clang::Type::castAs(), clang::SemaBase::Diag(), and clang::Type::isVectorType().
Definition at line 2747 of file SemaHLSL.cpp.
References clang::Sema::Context, clang::SemaBase::Diag(), clang::CallExpr::getArg(), and clang::Expr::MLV_Valid.
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
|
static |
Definition at line 2758 of file SemaHLSL.cpp.
References clang::SemaBase::Diag(), and clang::Type::getAs().
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
|
static |
Definition at line 2929 of file SemaHLSL.cpp.
References clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::Expr::getExprLoc(), clang::CallExpr::getNumArgs(), clang::Expr::getType(), and clang::QualType::getTypePtr().
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
|
static |
Definition at line 2815 of file SemaHLSL.cpp.
References clang::Sema::Context, clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::CallExpr::getNumArgs(), clang::Expr::getType(), and clang::ASTContext::hasSameUnqualifiedType().
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
|
static |
Definition at line 2795 of file SemaHLSL.cpp.
References clang::SemaBase::Diag(), and clang::Type::hasUnsignedIntegerRepresentation().
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
|
static |
Definition at line 2782 of file SemaHLSL.cpp.
References clang::SemaBase::Diag(), and clang::Type::getAs().
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
Definition at line 2881 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().
Definition at line 2848 of file SemaHLSL.cpp.
References clang::ASTContext::BoolTy, clang::Sema::Context, clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::Type::getAs(), clang::Sema::getASTContext(), clang::Stmt::getBeginLoc(), clang::CallExpr::getNumArgs(), clang::Expr::getType(), and clang::ASTContext::hasSameUnqualifiedType().
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
|
static |
Definition at line 83 of file SemaHLSL.cpp.
Referenced by clang::SemaHLSL::handleResourceBindingAttr().
|
static |
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().
|
static |
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().
| void createHostLayoutStructForBuffer | ( | Sema & | S, |
| HLSLBufferDecl * | BufDecl ) |
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().
|
static |
Definition at line 2193 of file SemaHLSL.cpp.
References DiagnoseLocalRegisterBinding(), clang::isa(), and ValidateMultipleRegisterAnnotations().
Referenced by clang::SemaHLSL::handleResourceBindingAttr().
|
static |
Definition at line 2092 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().
|
static |
Definition at line 404 of file SemaHLSL.cpp.
References clang::DeclContext::getNonTransparentContext(), and clang::DeclContext::lookup().
Referenced by createHostLayoutStruct(), and getHostLayoutStructName().
|
static |
Definition at line 421 of file SemaHLSL.cpp.
References findRecordDeclInContext(), clang::IdentifierTable::get(), clang::Sema::getASTContext(), clang::Decl::getDeclContext(), clang::NamedDecl::getIdentifier(), clang::IdentifierInfo::getName(), and clang::ASTContext::Idents.
Referenced by createHostLayoutStruct(), and createHostLayoutStructForBuffer().
|
static |
Definition at line 77 of file SemaHLSL.cpp.
References getRegisterType().
|
static |
Definition at line 63 of file SemaHLSL.cpp.
Referenced by clang::SemaHLSL::ActOnVariableDeclarator(), DiagnoseLocalRegisterBinding(), and getRegisterType().
|
static |
Definition at line 352 of file SemaHLSL.cpp.
References clang::Type::getArrayElementTypeNoTypeQual(), clang::ValueDecl::getType(), clang::Type::getUnqualifiedDesugaredType(), and clang::Type::isHLSLResourceRecordArray().
Referenced by clang::SemaHLSL::ActOnVariableDeclarator().
|
static |
Definition at line 115 of file SemaHLSL.cpp.
|
static |
Definition at line 1060 of file SemaHLSL.cpp.
References clang::Type::isIntegralType(), and clang::Type::isRealFloatingType().
Referenced by clang::SemaHLSL::handleVectorBinOpConversion().
|
static |
Definition at line 133 of file SemaHLSL.cpp.
References clang::Type::isEnumeralType(), and clang::Builtin::NotBuiltin.
Referenced by clang::SemaHLSL::handleInitialization(), and clang::SemaHLSL::mergeVkConstantIdAttr().
|
static |
Definition at line 983 of file SemaHLSL.cpp.
References castElement(), clang::Sema::getASTContext(), clang::ASTContext::getFloatingTypeOrder(), and clang::Type::isRealFloatingType().
Referenced by clang::SemaHLSL::handleVectorBinOpConversion().
|
static |
Definition at line 1007 of file SemaHLSL.cpp.
References clang::Type::castAs(), castElement(), clang::Sema::Context, clang::Sema::getASTContext(), clang::ASTContext::getIntegerTypeOrder(), clang::VectorType::getNumElements(), and clang::Type::hasSignedIntegerRepresentation().
Referenced by clang::SemaHLSL::handleVectorBinOpConversion().
|
static |
Definition at line 1305 of file SemaHLSL.cpp.
References clang::RecordDecl::field_begin(), clang::RecordDecl::field_empty(), clang::RecordDecl::field_end(), clang::Type::getAs(), and clang::ValueDecl::getType().
Referenced by clang::SemaHLSL::ActOnVariableDeclarator().
Definition at line 3780 of file SemaHLSL.cpp.
References clang::Default, clang::QualType::getAddressSpace(), clang::Decl::getDeclContext(), clang::VarDecl::getStorageClass(), clang::ValueDecl::getType(), clang::QualType::getTypePtr(), clang::Decl::hasAttr(), isInvalidConstantBufferLeafElementType(), clang::DeclContext::isTranslationUnit(), and clang::SC_Static.
Referenced by clang::SemaHLSL::ActOnVariableDeclarator().
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().
Definition at line 346 of file SemaHLSL.cpp.
References clang::ValueDecl::getType(), clang::QualType::getTypePtr(), clang::Type::isHLSLResourceRecord(), and clang::Type::isHLSLResourceRecordArray().
Referenced by clang::SemaHLSL::ActOnVariableDeclarator().
Definition at line 1582 of file SemaHLSL.cpp.
Referenced by clang::SemaHLSL::handleWaveSizeAttr().
|
static |
Definition at line 339 of file SemaHLSL.cpp.
References clang::ArrayType::getElementType(), clang::Type::getUnqualifiedDesugaredType(), and clang::ConstantArrayType::isZeroSize().
Referenced by clang::SemaSYCL::deepTypeCheckForDevice(), and isInvalidConstantBufferLeafElementType().
|
static |
Definition at line 384 of file SemaHLSL.cpp.
References clang::CXXRecordDecl::bases(), clang::RecordDecl::fields(), clang::Type::getAsCXXRecordDecl(), clang::QualType::getTypePtr(), clang::CXXRecordDecl::isEmpty(), clang::CXXRecordDecl::isHLSLIntangible(), isInvalidConstantBufferLeafElementType(), and requiresImplicitBufferLayoutStructure().
Referenced by createFieldForHostLayoutStruct(), createHostLayoutStruct(), and requiresImplicitBufferLayoutStructure().
Definition at line 2805 of file SemaHLSL.cpp.
References clang::Sema::Context, clang::CallExpr::getArg(), clang::Type::getAs(), clang::ASTContext::getExtVectorType(), clang::Expr::getType(), and clang::Expr::setType().
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
|
static |
Definition at line 2168 of file SemaHLSL.cpp.
References clang::Decl::attr_begin(), clang::Decl::attr_end(), clang::SemaBase::Diag(), and clang::Decl::getLocation().
Referenced by DiagnoseHLSLRegisterAttribute().
|
static |
Definition at line 286 of file SemaHLSL.cpp.
References clang::HLSLBufferDecl::buffer_decls(), calculateLegacyCbufferSize(), clang::SemaBase::Diag(), clang::Sema::getASTContext(), clang::Decl::getAttr(), clang::Decl::getLocation(), clang::ValueDecl::getType(), and clang::HLSLBufferDecl::setHasValidPackoffset().
Referenced by clang::SemaHLSL::ActOnFinishBuffer().