clang 20.0.0git
Typedefs | Functions
SemaHLSL.cpp File Reference
#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/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/LLVM.h"
#include "clang/Basic/SourceLocation.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/Support/Casting.h"
#include "llvm/Support/DXILABI.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/TargetParser/Triple.h"
#include <iterator>
#include <utility>

Go to the source code of this file.

Typedefs

using RegisterType = HLSLResourceBindingAttr::RegisterType
 

Functions

static RegisterType getRegisterType (ResourceClass RC)
 
static bool convertToRegisterType (StringRef Slot, RegisterType *RT)
 
static ResourceClass getResourceClass (RegisterType RT)
 
static unsigned calculateLegacyCbufferSize (const ASTContext &Context, QualType T)
 
template<CastKind Kind>
static void castVector (Sema &S, ExprResult &E, QualType &Ty, unsigned Sz)
 
template<CastKind Kind>
static QualType castElement (Sema &S, ExprResult &E, QualType Ty)
 
static QualType handleFloatVectorBinOpConversion (Sema &SemaRef, ExprResult &LHS, ExprResult &RHS, QualType LHSType, QualType RHSType, QualType LElTy, QualType RElTy, bool IsCompAssign)
 
static QualType handleIntegerVectorBinOpConversion (Sema &SemaRef, ExprResult &LHS, ExprResult &RHS, QualType LHSType, QualType RHSType, QualType LElTy, QualType RElTy, bool IsCompAssign)
 
static CastKind getScalarCastKind (ASTContext &Ctx, QualType DestTy, QualType SrcTy)
 
static bool isValidWaveSizeValue (unsigned Value)
 
static bool DiagnoseLocalRegisterBinding (Sema &S, SourceLocation &ArgLoc, Decl *D, RegisterType RegType, bool SpecifiedSpace)
 
static bool ValidateMultipleRegisterAnnotations (Sema &S, Decl *TheDecl, RegisterType regType)
 
static bool DiagnoseHLSLRegisterAttribute (Sema &S, SourceLocation &ArgLoc, Decl *D, RegisterType RegType, bool SpecifiedSpace)
 
static bool CheckVectorElementCallArgs (Sema *S, CallExpr *TheCall)
 
static bool CheckArgTypeMatches (Sema *S, Expr *Arg, QualType ExpectedType)
 
static bool CheckArgTypeIsCorrect (Sema *S, Expr *Arg, QualType ExpectedType, llvm::function_ref< bool(clang::QualType PassedType)> Check)
 
static bool CheckAllArgTypesAreCorrect (Sema *S, CallExpr *TheCall, QualType ExpectedType, llvm::function_ref< bool(clang::QualType PassedType)> Check)
 
static bool CheckAllArgsHaveFloatRepresentation (Sema *S, CallExpr *TheCall)
 
static bool CheckFloatOrHalfRepresentations (Sema *S, CallExpr *TheCall)
 
static bool CheckModifiableLValue (Sema *S, CallExpr *TheCall, unsigned ArgIndex)
 
static bool CheckNoDoubleVectors (Sema *S, CallExpr *TheCall)
 
static bool CheckFloatingOrIntRepresentation (Sema *S, CallExpr *TheCall)
 
static bool CheckUnsignedIntRepresentation (Sema *S, CallExpr *TheCall)
 
static void SetElementTypeAsReturnType (Sema *S, CallExpr *TheCall, QualType ReturnType)
 
static bool CheckScalarOrVector (Sema *S, CallExpr *TheCall, QualType Scalar, unsigned ArgIndex)
 
static bool CheckAnyScalarOrVector (Sema *S, CallExpr *TheCall, unsigned ArgIndex)
 
static bool CheckBoolSelect (Sema *S, CallExpr *TheCall)
 
static bool CheckVectorSelect (Sema *S, CallExpr *TheCall)
 
static bool CheckResourceHandle (Sema *S, CallExpr *TheCall, unsigned ArgIndex, llvm::function_ref< bool(const HLSLAttributedResourceType *ResType)> Check=nullptr)
 
static void BuildFlattenedTypeList (QualType BaseTy, llvm::SmallVectorImpl< QualType > &List)
 

Typedef Documentation

◆ RegisterType

using RegisterType = HLSLResourceBindingAttr::RegisterType

Definition at line 43 of file SemaHLSL.cpp.

Function Documentation

◆ BuildFlattenedTypeList()

static void BuildFlattenedTypeList ( QualType  BaseTy,
llvm::SmallVectorImpl< QualType > &  List 
)
static

◆ calculateLegacyCbufferSize()

static unsigned calculateLegacyCbufferSize ( const ASTContext Context,
QualType  T 
)
static

◆ castElement()

template<CastKind Kind>
static QualType castElement ( Sema S,
ExprResult E,
QualType  Ty 
)
static

Definition at line 471 of file SemaHLSL.cpp.

References E, and clang::Sema::ImpCastExprToType().

◆ castVector()

template<CastKind Kind>
static void castVector ( Sema S,
ExprResult E,
QualType Ty,
unsigned  Sz 
)
static

◆ CheckAllArgsHaveFloatRepresentation()

static bool CheckAllArgsHaveFloatRepresentation ( Sema S,
CallExpr TheCall 
)
static

◆ CheckAllArgTypesAreCorrect()

static bool CheckAllArgTypesAreCorrect ( Sema S,
CallExpr TheCall,
QualType  ExpectedType,
llvm::function_ref< bool(clang::QualType PassedType)>  Check 
)
static

◆ CheckAnyScalarOrVector()

static bool CheckAnyScalarOrVector ( Sema S,
CallExpr TheCall,
unsigned  ArgIndex 
)
static

◆ CheckArgTypeIsCorrect()

static bool CheckArgTypeIsCorrect ( Sema S,
Expr Arg,
QualType  ExpectedType,
llvm::function_ref< bool(clang::QualType PassedType)>  Check 
)
static

◆ CheckArgTypeMatches()

static bool CheckArgTypeMatches ( Sema S,
Expr Arg,
QualType  ExpectedType 
)
static

◆ CheckBoolSelect()

static bool CheckBoolSelect ( Sema S,
CallExpr TheCall 
)
static

◆ CheckFloatingOrIntRepresentation()

static bool CheckFloatingOrIntRepresentation ( Sema S,
CallExpr TheCall 
)
static

◆ CheckFloatOrHalfRepresentations()

static bool CheckFloatOrHalfRepresentations ( Sema S,
CallExpr TheCall 
)
static

◆ CheckModifiableLValue()

static bool CheckModifiableLValue ( Sema S,
CallExpr TheCall,
unsigned  ArgIndex 
)
static

◆ CheckNoDoubleVectors()

static bool CheckNoDoubleVectors ( Sema S,
CallExpr TheCall 
)
static

◆ CheckResourceHandle()

static bool CheckResourceHandle ( Sema S,
CallExpr TheCall,
unsigned  ArgIndex,
llvm::function_ref< bool(const HLSLAttributedResourceType *ResType)>  Check = nullptr 
)
static

◆ CheckScalarOrVector()

static bool CheckScalarOrVector ( Sema S,
CallExpr TheCall,
QualType  Scalar,
unsigned  ArgIndex 
)
static

◆ CheckUnsignedIntRepresentation()

static bool CheckUnsignedIntRepresentation ( Sema S,
CallExpr TheCall 
)
static

◆ CheckVectorElementCallArgs()

static bool CheckVectorElementCallArgs ( Sema S,
CallExpr TheCall 
)
static

◆ CheckVectorSelect()

static bool CheckVectorSelect ( Sema S,
CallExpr TheCall 
)
static

◆ convertToRegisterType()

static bool convertToRegisterType ( StringRef  Slot,
RegisterType RT 
)
static

Definition at line 61 of file SemaHLSL.cpp.

Referenced by clang::SemaHLSL::handleResourceBindingAttr().

◆ DiagnoseHLSLRegisterAttribute()

static bool DiagnoseHLSLRegisterAttribute ( Sema S,
SourceLocation ArgLoc,
Decl D,
RegisterType  RegType,
bool  SpecifiedSpace 
)
static

◆ DiagnoseLocalRegisterBinding()

static bool DiagnoseLocalRegisterBinding ( Sema S,
SourceLocation ArgLoc,
Decl D,
RegisterType  RegType,
bool  SpecifiedSpace 
)
static

◆ getRegisterType()

static RegisterType getRegisterType ( ResourceClass  RC)
static

Definition at line 45 of file SemaHLSL.cpp.

Referenced by DiagnoseLocalRegisterBinding().

◆ getResourceClass()

static ResourceClass getResourceClass ( RegisterType  RT)
static

Definition at line 93 of file SemaHLSL.cpp.

◆ getScalarCastKind()

static CastKind getScalarCastKind ( ASTContext Ctx,
QualType  DestTy,
QualType  SrcTy 
)
static

◆ handleFloatVectorBinOpConversion()

static QualType handleFloatVectorBinOpConversion ( Sema SemaRef,
ExprResult LHS,
ExprResult RHS,
QualType  LHSType,
QualType  RHSType,
QualType  LElTy,
QualType  RElTy,
bool  IsCompAssign 
)
static

◆ handleIntegerVectorBinOpConversion()

static QualType handleIntegerVectorBinOpConversion ( Sema SemaRef,
ExprResult LHS,
ExprResult RHS,
QualType  LHSType,
QualType  RHSType,
QualType  LElTy,
QualType  RElTy,
bool  IsCompAssign 
)
static

◆ isValidWaveSizeValue()

static bool isValidWaveSizeValue ( unsigned  Value)
static

Definition at line 701 of file SemaHLSL.cpp.

Referenced by clang::SemaHLSL::handleWaveSizeAttr().

◆ SetElementTypeAsReturnType()

static void SetElementTypeAsReturnType ( Sema S,
CallExpr TheCall,
QualType  ReturnType 
)
static

◆ ValidateMultipleRegisterAnnotations()

static bool ValidateMultipleRegisterAnnotations ( Sema S,
Decl TheDecl,
RegisterType  regType 
)
static