clang 20.0.0git
|
#include "clang/Sema/SemaHLSL.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/ParsedAttr.h"
#include "clang/Sema/Sema.h"
#include "clang/Sema/Template.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/Support/Casting.h"
#include "llvm/Support/DXILABI.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/TargetParser/Triple.h"
#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 48 of file SemaHLSL.cpp.
|
static |
Definition at line 2558 of file SemaHLSL.cpp.
References clang::CXXRecordDecl::bases(), BuildFlattenedTypeList(), clang::RecordDecl::fields(), clang::RecordType::getDecl(), clang::CXXRecordDecl::getStandardLayoutBaseWithFields(), clang::ValueDecl::getType(), clang::CXXRecordDecl::isStandardLayout(), clang::TagDecl::isUnion(), and clang::T.
Referenced by BuildFlattenedTypeList(), and clang::SemaHLSL::IsScalarizedLayoutCompatible().
|
static |
Definition at line 177 of file SemaHLSL.cpp.
References calculateLegacyCbufferSize(), clang::RecordDecl::fields(), clang::Type::getAs(), clang::ASTContext::getAsConstantArrayType(), clang::ASTContext::getTypeSize(), clang::Type::isAggregateType(), and clang::T.
Referenced by calculateLegacyCbufferSize(), and validatePackoffset().
|
static |
Definition at line 730 of file SemaHLSL.cpp.
References E, and clang::Sema::ImpCastExprToType().
|
static |
Definition at line 722 of file SemaHLSL.cpp.
References E, clang::Type::getAs(), clang::Sema::getASTContext(), clang::ASTContext::getExtVectorType(), and clang::Sema::ImpCastExprToType().
Definition at line 2026 of file SemaHLSL.cpp.
References CheckAllArgTypesAreCorrect(), clang::Sema::Context, and clang::ASTContext::FloatTy.
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
|
static |
Definition at line 2014 of file SemaHLSL.cpp.
References CheckArgTypeIsCorrect(), clang::CallExpr::getArg(), and clang::CallExpr::getNumArgs().
Referenced by CheckAllArgsHaveFloatRepresentation(), CheckFloatingOrIntRepresentation(), CheckFloatOrHalfRepresentations(), CheckNoDoubleVectors(), and CheckUnsignedIntRepresentation().
Definition at line 2109 of file SemaHLSL.cpp.
References clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::CallExpr::getNumArgs(), clang::Expr::getType(), and clang::Type::isScalarType().
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
|
static |
Definition at line 1999 of file SemaHLSL.cpp.
References clang::Sema::Context, clang::SemaBase::Diag(), clang::Type::getAs(), clang::Stmt::getBeginLoc(), clang::Expr::getType(), and clang::ASTContext::getVectorType().
Referenced by CheckAllArgTypesAreCorrect().
Definition at line 1989 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 2142 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().
Definition at line 2066 of file SemaHLSL.cpp.
References CheckAllArgTypesAreCorrect(), clang::Sema::Context, and clang::ASTContext::IntTy.
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
Definition at line 2034 of file SemaHLSL.cpp.
References CheckAllArgTypesAreCorrect(), clang::Sema::Context, clang::ASTContext::FloatTy, clang::Type::isFloat32Type(), clang::Type::isHalfType(), and clang::Type::isVectorType().
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
Definition at line 2046 of file SemaHLSL.cpp.
References clang::Sema::Context, clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::Expr::getExprLoc(), clang::Expr::IgnoreCasts(), clang::Expr::isModifiableLvalue(), and clang::Expr::MLV_Valid.
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
Definition at line 2057 of file SemaHLSL.cpp.
References CheckAllArgTypesAreCorrect(), clang::Sema::Context, and clang::ASTContext::FloatTy.
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
|
static |
Definition at line 2198 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 2092 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().
Definition at line 2075 of file SemaHLSL.cpp.
References CheckAllArgTypesAreCorrect(), clang::Sema::Context, and clang::ASTContext::UnsignedIntTy.
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
Definition at line 1929 of file SemaHLSL.cpp.
References clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::CallExpr::getArg(), clang::Type::getAs(), clang::CallExpr::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::CallExpr::getDirectCallee(), clang::Stmt::getEndLoc(), clang::CallExpr::getNumArgs(), and clang::Expr::getType().
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
Definition at line 2158 of file SemaHLSL.cpp.
References clang::Sema::Context, clang::SemaBase::Diag(), clang::CallExpr::getArg(), clang::Type::getAs(), clang::CallExpr::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::CallExpr::getDirectCallee(), clang::CallExpr::getNumArgs(), clang::VectorType::getNumElements(), clang::Stmt::getSourceRange(), clang::Expr::getType(), clang::ASTContext::hasSameUnqualifiedType(), clang::Type::isVectorType(), and clang::Expr::setType().
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
Definition at line 2125 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 69 of file SemaHLSL.cpp.
Referenced by clang::SemaHLSL::handleResourceBindingAttr().
|
static |
Definition at line 374 of file SemaHLSL.cpp.
References clang::AS_private, clang::FieldDecl::Create(), createHostLayoutStruct(), clang::Type::getAsCXXRecordDecl(), clang::Sema::getASTContext(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::TypeDecl::getTypeForDecl(), clang::ICIS_NoInit, isInvalidConstantBufferLeafElementType(), clang::Type::isRecordType(), and requiresImplicitBufferLayoutStructure().
Referenced by createHostLayoutStruct(), and createHostLayoutStructForBuffer().
|
static |
Definition at line 407 of file SemaHLSL.cpp.
References 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::Decl::getDeclContext(), getHostLayoutStructName(), clang::CXXRecordDecl::getNumBases(), clang::ASTContext::getTrivialTypeSourceInfo(), clang::TypeDecl::getTypeForDecl(), 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 470 of file SemaHLSL.cpp.
References clang::DeclContext::addDecl(), clang::CXXRecordDecl::completeDefinition(), clang::CXXRecordDecl::Create(), createFieldForHostLayoutStruct(), D, clang::DeclContext::decls(), clang::ASTContext::getAddrSpaceQualType(), clang::Sema::getASTContext(), getHostLayoutStructName(), clang::NamedDecl::getIdentifier(), clang::VarDecl::getStorageClass(), clang::ValueDecl::getType(), clang::Type::getUnqualifiedDesugaredType(), clang::hlsl_constant, clang::SC_Static, clang::Decl::setImplicit(), clang::ValueDecl::setType(), and clang::TagDecl::startDefinition().
Referenced by clang::SemaHLSL::ActOnFinishBuffer().
|
static |
Definition at line 1466 of file SemaHLSL.cpp.
References D, DiagnoseLocalRegisterBinding(), and ValidateMultipleRegisterAnnotations().
Referenced by clang::SemaHLSL::handleResourceBindingAttr().
|
static |
Definition at line 1367 of file SemaHLSL.cpp.
References D, clang::SemaBase::Diag(), clang::HLSLAttributedResourceType::findHandleTypeOnResource(), clang::Type::getArrayElementTypeNoTypeQual(), clang::Sema::getASTContext(), clang::Decl::getDeclContext(), clang::Decl::getLocation(), getRegisterType(), clang::ValueDecl::getType(), clang::QualType::getTypePtr(), clang::Decl::hasAttr(), clang::Type::isArithmeticType(), clang::Type::isArrayType(), clang::Type::isFloatingType(), clang::Type::isIntegralType(), and clang::Type::isRecordType().
Referenced by DiagnoseHLSLRegisterAttribute().
|
static |
Definition at line 320 of file SemaHLSL.cpp.
References clang::DeclContext::getNonTransparentContext(), and clang::DeclContext::lookup().
Referenced by createHostLayoutStruct(), and getHostLayoutStructName().
|
static |
Definition at line 337 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 53 of file SemaHLSL.cpp.
Referenced by DiagnoseLocalRegisterBinding().
|
static |
Definition at line 101 of file SemaHLSL.cpp.
|
static |
Definition at line 812 of file SemaHLSL.cpp.
References clang::Type::isIntegralType(), and clang::Type::isRealFloatingType().
Referenced by clang::SemaHLSL::handleVectorBinOpConversion().
|
static |
Definition at line 735 of file SemaHLSL.cpp.
References clang::Sema::getASTContext(), clang::ASTContext::getFloatingTypeOrder(), and clang::Type::isRealFloatingType().
Referenced by clang::SemaHLSL::handleVectorBinOpConversion().
|
static |
Definition at line 759 of file SemaHLSL.cpp.
References clang::Type::castAs(), clang::Sema::Context, clang::Sema::getASTContext(), clang::ASTContext::getCorrespondingUnsignedType(), clang::ASTContext::getExtVectorType(), clang::ASTContext::getIntegerTypeOrder(), clang::ASTContext::getIntWidth(), clang::VectorType::getNumElements(), and clang::Type::hasSignedIntegerRepresentation().
Referenced by clang::SemaHLSL::handleVectorBinOpConversion().
Definition at line 281 of file SemaHLSL.cpp.
References clang::Type::getAsCXXRecordDecl(), clang::Type::isConstantArrayType(), clang::CXXRecordDecl::isEmpty(), clang::Type::isHLSLBuiltinIntangibleType(), clang::Type::isRecordType(), isResourceRecordType(), and isZeroSizedArray().
Referenced by createFieldForHostLayoutStruct(), and requiresImplicitBufferLayoutStructure().
Definition at line 273 of file SemaHLSL.cpp.
References clang::HLSLAttributedResourceType::findHandleTypeOnResource().
Definition at line 960 of file SemaHLSL.cpp.
Referenced by clang::SemaHLSL::handleWaveSizeAttr().
|
static |
Definition at line 265 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 300 of file SemaHLSL.cpp.
References clang::CXXRecordDecl::bases(), clang::RecordDecl::fields(), clang::Type::getAsCXXRecordDecl(), clang::TypeDecl::getTypeForDecl(), clang::QualType::getTypePtr(), clang::CXXRecordDecl::isEmpty(), clang::Type::isHLSLIntangibleType(), isInvalidConstantBufferLeafElementType(), clang::Type::isRecordType(), and requiresImplicitBufferLayoutStructure().
Referenced by createFieldForHostLayoutStruct(), createHostLayoutStruct(), and requiresImplicitBufferLayoutStructure().
Definition at line 2083 of file SemaHLSL.cpp.
References clang::Sema::Context, clang::Generic, clang::CallExpr::getArg(), clang::Type::getAs(), clang::Expr::getType(), clang::ASTContext::getVectorType(), and clang::Expr::setType().
Referenced by clang::SemaHLSL::CheckBuiltinFunctionCall().
|
static |
Definition at line 1441 of file SemaHLSL.cpp.
References clang::ast_matchers::attr, clang::Decl::attr_begin(), clang::Decl::attr_end(), clang::SemaBase::Diag(), and clang::Decl::getLocation().
Referenced by DiagnoseHLSLRegisterAttribute().
|
static |
Definition at line 215 of file SemaHLSL.cpp.
References Begin, calculateLegacyCbufferSize(), clang::DeclContext::decls(), clang::SemaBase::Diag(), clang::Sema::getASTContext(), clang::Decl::getLocation(), and clang::ValueDecl::getType().
Referenced by clang::SemaHLSL::ActOnFinishBuffer().
Follow Lee on X/Twitter - Father, Husband, Serial builder creating AI, crypto, games & web tools. We are friends :) AI Will Come To Life!
Check out: eBank.nz (Art Generator) |
Netwrck.com (AI Tools) |
Text-Generator.io (AI API) |
BitBank.nz (Crypto AI) |
ReadingTime (Kids Reading) |
RewordGame |
BigMultiplayerChess |
WebFiddle |
How.nz |
Helix AI Assistant