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/Type.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 55 of file SemaHLSL.cpp.
|
static |
Definition at line 583 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 3290 of file SemaHLSL.cpp.
References BuildFlattenedTypeList(), clang::RecordDecl::fields(), clang::ValueDecl::getType(), clang::isa(), clang::TagDecl::isUnion(), and clang::T.
Referenced by BuildFlattenedTypeList(), clang::SemaHLSL::CanPerformAggregateSplatCast(), clang::SemaHLSL::CanPerformElementwiseCast(), and clang::SemaHLSL::IsScalarizedLayoutCompatible().
|
static |
Definition at line 217 of file SemaHLSL.cpp.
References calculateLegacyCbufferFieldAlign(), and clang::T.
Referenced by calculateLegacyCbufferFieldAlign(), and calculateLegacyCbufferSize().
|
static |
Definition at line 236 of file SemaHLSL.cpp.
References calculateLegacyCbufferFieldAlign(), calculateLegacyCbufferSize(), and clang::T.
Referenced by calculateLegacyCbufferSize(), and validatePackoffset().
|
static |
Definition at line 915 of file SemaHLSL.cpp.
References clang::ActionResult< PtrTy, Compress >::get(), and clang::Sema::ImpCastExprToType().
Referenced by handleFloatVectorBinOpConversion(), and handleIntegerVectorBinOpConversion().
|
static |
Definition at line 907 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 2610 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 2637 of file SemaHLSL.cpp.
References clang::CallExpr::getArg(), clang::Stmt::getBeginLoc(), clang::CallExpr::getNumArgs(), and clang::Expr::getType().
Definition at line 2749 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 2627 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 2782 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 2688 of file SemaHLSL.cpp.
References clang::SemaBase::Diag(), clang::Type::hasFloatingRepresentation(), and clang::Type::hasIntegerRepresentation().
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
|
static |
Definition at line 2650 of file SemaHLSL.cpp.
References clang::Type::castAs(), clang::SemaBase::Diag(), and clang::Type::isVectorType().
Definition at line 2664 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 2675 of file SemaHLSL.cpp.
References clang::SemaBase::Diag(), and clang::Type::getAs().
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
|
static |
Definition at line 2846 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 2732 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 2712 of file SemaHLSL.cpp.
References clang::SemaBase::Diag(), and clang::Type::hasUnsignedIntegerRepresentation().
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
|
static |
Definition at line 2699 of file SemaHLSL.cpp.
References clang::SemaBase::Diag(), and clang::Type::getAs().
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
Definition at line 2798 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 2765 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 80 of file SemaHLSL.cpp.
Referenced by clang::SemaHLSL::handleResourceBindingAttr().
|
static |
Definition at line 455 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 487 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 552 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 2110 of file SemaHLSL.cpp.
References DiagnoseLocalRegisterBinding(), clang::isa(), and ValidateMultipleRegisterAnnotations().
Referenced by clang::SemaHLSL::handleResourceBindingAttr().
|
static |
Definition at line 2009 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 401 of file SemaHLSL.cpp.
References clang::DeclContext::getNonTransparentContext(), and clang::DeclContext::lookup().
Referenced by createHostLayoutStruct(), and getHostLayoutStructName().
|
static |
Definition at line 418 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 74 of file SemaHLSL.cpp.
References getRegisterType().
|
static |
Definition at line 60 of file SemaHLSL.cpp.
Referenced by clang::SemaHLSL::ActOnVariableDeclarator(), DiagnoseLocalRegisterBinding(), and getRegisterType().
|
static |
Definition at line 349 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 112 of file SemaHLSL.cpp.
|
static |
Definition at line 997 of file SemaHLSL.cpp.
References clang::Type::isIntegralType(), and clang::Type::isRealFloatingType().
Referenced by clang::SemaHLSL::handleVectorBinOpConversion().
|
static |
Definition at line 130 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 920 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 944 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().
Definition at line 3693 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 362 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 343 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 1508 of file SemaHLSL.cpp.
Referenced by clang::SemaHLSL::handleWaveSizeAttr().
|
static |
Definition at line 336 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 381 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 2722 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 2085 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 283 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().