#include ">

clang: lib/Sema/SemaHLSL.cpp File Reference (original) (raw)

#include "[clang/Sema/SemaHLSL.h](SemaHLSL%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/DynamicRecursiveASTVisitor.h](DynamicRecursiveASTVisitor%5F8h%5Fsource.html)"
#include "[clang/AST/Expr.h](Expr%5F8h%5Fsource.html)"
#include "[clang/AST/Type.h](Type%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/LLVM.h](LLVM%5F8h%5Fsource.html)"
#include "[clang/Basic/SourceLocation.h](SourceLocation%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/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/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)
static void validatePackoffset (Sema &S, HLSLBufferDecl *BufDecl)
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 CheckWaveActive (Sema *S, CallExpr *TheCall)
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)

RegisterType

BuildFlattenedTypeList()

calculateLegacyCbufferSize()

castElement()

castVector()

CheckAllArgsHaveFloatRepresentation()

static bool CheckAllArgsHaveFloatRepresentation ( Sema * S, CallExpr * TheCall ) static

CheckAllArgTypesAreCorrect()

CheckAnyScalarOrVector()

CheckArgTypeIsCorrect()

CheckArgTypeMatches()

CheckBoolSelect()

CheckFloatingOrIntRepresentation()

static bool CheckFloatingOrIntRepresentation ( Sema * S, CallExpr * TheCall ) static

CheckFloatOrHalfRepresentations()

static bool CheckFloatOrHalfRepresentations ( Sema * S, CallExpr * TheCall ) static

CheckModifiableLValue()

CheckNoDoubleVectors()

CheckResourceHandle()

CheckScalarOrVector()

CheckUnsignedIntRepresentation()

static bool CheckUnsignedIntRepresentation ( Sema * S, CallExpr * TheCall ) static

CheckVectorElementCallArgs()

Definition at line 1682 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().

CheckVectorSelect()

Definition at line 1911 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().

CheckWaveActive()

convertToRegisterType()

DiagnoseHLSLRegisterAttribute()

DiagnoseLocalRegisterBinding()

Definition at line 1120 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().

getRegisterType()

static RegisterType getRegisterType ( ResourceClass RC) static

getResourceClass()

static ResourceClass getResourceClass ( RegisterType RT) static

getScalarCastKind()

handleFloatVectorBinOpConversion()

handleIntegerVectorBinOpConversion()

isValidWaveSizeValue()

SetElementTypeAsReturnType()

ValidateMultipleRegisterAnnotations()

validatePackoffset()