clang 20.0.0git
|
#include "clang/Sema/SemaHLSL.h"
Additional Inherited Members | |
Public Attributes inherited from clang::SemaBase | |
Sema & | SemaRef |
Definition at line 85 of file SemaHLSL.h.
SemaHLSL::SemaHLSL | ( | Sema & | S | ) |
Definition at line 142 of file SemaHLSL.cpp.
void SemaHLSL::ActOnFinishBuffer | ( | Decl * | Dcl, |
SourceLocation | RBrace | ||
) |
Definition at line 202 of file SemaHLSL.cpp.
References Begin, calculateLegacyCbufferSize(), clang::SemaBase::Diag(), clang::SemaBase::getASTContext(), clang::Decl::getLocation(), clang::ValueDecl::getType(), clang::Sema::PopDeclContext(), and clang::SemaBase::SemaRef.
ExprResult SemaHLSL::ActOnOutParamExpr | ( | ParmVarDecl * | Param, |
Expr * | Arg | ||
) |
Definition at line 2425 of file SemaHLSL.cpp.
References clang::Sema::ActOnBinOp(), clang::HLSLOutArgExpr::Create(), clang::SemaBase::Diag(), clang::ExprError(), clang::ActionResult< PtrTy, Compress >::get(), clang::Sema::getASTContext(), clang::Decl::getAttr(), clang::DeclaratorDecl::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::Sema::getCurScope(), clang::QualType::getNonLValueExprType(), clang::ValueDecl::getType(), clang::Expr::getType(), clang::Decl::hasAttr(), clang::HLSLInOut, clang::InitializedEntity::InitializeParameter(), clang::ActionResult< PtrTy, Compress >::isInvalid(), clang::Expr::isLValue(), clang::Type::isScalarType(), clang::OK_Ordinary, clang::Ordinary, clang::Sema::PerformCopyInitialization(), clang::SemaBase::SemaRef, and clang::VK_LValue.
Referenced by clang::Sema::GatherArgumentsForCall().
Decl * SemaHLSL::ActOnStartBuffer | ( | Scope * | BufferScope, |
bool | CBuffer, | ||
SourceLocation | KwLoc, | ||
IdentifierInfo * | Ident, | ||
SourceLocation | IdentLoc, | ||
SourceLocation | LBrace | ||
) |
Definition at line 144 of file SemaHLSL.cpp.
References clang::HLSLBufferDecl::Create(), clang::SemaBase::getASTContext(), clang::Sema::getCurLexicalContext(), clang::Sema::PushDeclContext(), clang::Sema::PushOnScopeChains(), clang::Result, and clang::SemaBase::SemaRef.
void SemaHLSL::ActOnTopLevelFunction | ( | FunctionDecl * | FD | ) |
Definition at line 320 of file SemaHLSL.cpp.
References clang::Decl::addAttr(), clang::SemaBase::Diag(), Env, clang::SemaBase::getASTContext(), clang::Decl::getAttr(), clang::DeclaratorDecl::getBeginLoc(), clang::NamedDecl::getName(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTargetOpts(), clang::TargetInfo::getTriple(), clang::TargetOptions::HLSLEntry, and clang::Decl::setInvalidDecl().
Referenced by clang::Sema::ActOnFunctionDeclarator().
void SemaHLSL::ActOnVariableDeclarator | ( | VarDecl * | VD | ) |
Definition at line 2494 of file SemaHLSL.cpp.
References clang::Sema::getASTContext(), clang::ASTContext::getBaseElementType(), clang::Decl::getLocation(), clang::ValueDecl::getType(), clang::VarDecl::hasGlobalStorage(), clang::Type::isHLSLIntangibleType(), clang::Sema::RequireCompleteType(), clang::SemaBase::SemaRef, and clang::Decl::setInvalidDecl().
Referenced by clang::Sema::ActOnVariableDeclarator().
Definition at line 1937 of file SemaHLSL.cpp.
References std::abs(), clang::Sema::BuiltinElementwiseTernaryMath(), clang::Sema::BuiltinVectorToScalarMath(), clang::Type::castAs(), CheckAllArgsHaveFloatRepresentation(), CheckAnyScalarOrVector(), clang::Sema::checkArgCount(), CheckArgTypeMatches(), CheckBoolSelect(), CheckFloatingOrIntRepresentation(), CheckFloatOrHalfRepresentations(), CheckModifiableLValue(), CheckNoDoubleVectors(), CheckResourceHandle(), CheckScalarOrVector(), CheckUnsignedIntRepresentation(), CheckVectorElementCallArgs(), CheckVectorSelect(), clang::Sema::Context, clang::SemaBase::Diag(), clang::ASTContext::DoubleTy, clang::ASTContext::FloatTy, clang::ActionResult< PtrTy, Compress >::get(), clang::CallExpr::getArg(), clang::Type::getAs(), clang::Sema::getASTContext(), clang::SemaBase::getASTContext(), clang::CallExpr::getBeginLoc(), clang::Stmt::getBeginLoc(), clang::Expr::getIntegerConstantExpr(), clang::ASTContext::getPointerType(), clang::Expr::getType(), clang::ASTContext::getVectorType(), clang::Type::hasFloatingRepresentation(), clang::ASTContext::IntTy, clang::Type::isBooleanType(), clang::Type::isIntegerType(), clang::Sema::PrepareBuiltinElementwiseMathOneArgCall(), clang::SemaBase::SemaRef, SetElementTypeAsReturnType(), clang::Expr::setType(), clang::Expr::setValueKind(), clang::ASTContext::UnsignedIntTy, and clang::VK_LValue.
bool SemaHLSL::CheckCompatibleParameterABI | ( | FunctionDecl * | New, |
FunctionDecl * | Old | ||
) |
Definition at line 2393 of file SemaHLSL.cpp.
References clang::SemaBase::Diag(), clang::Decl::getAttr(), clang::Decl::getLocation(), clang::FunctionDecl::getNumParams(), clang::FunctionDecl::getParamDecl(), and clang::SemaBase::SemaRef.
void SemaHLSL::CheckEntryPoint | ( | FunctionDecl * | FD | ) |
Definition at line 353 of file SemaHLSL.cpp.
References CheckSemanticAnnotation(), clang::SemaBase::Diag(), DiagnoseAttrStageMismatch(), clang::SemaBase::getASTContext(), clang::Decl::getAttr(), clang::Decl::getLocation(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), clang::Decl::hasAttr(), clang::FunctionDecl::parameters(), and clang::Decl::setInvalidDecl().
Referenced by clang::Sema::ActOnFunctionDeclarator().
void SemaHLSL::CheckSemanticAnnotation | ( | FunctionDecl * | EntryPoint, |
const Decl * | Param, | ||
const HLSLAnnotationAttr * | AnnotationAttr | ||
) |
Definition at line 427 of file SemaHLSL.cpp.
References DiagnoseAttrStageMismatch(), clang::Decl::getAttr(), and clang::Attr::getKind().
Referenced by CheckEntryPoint().
void SemaHLSL::DiagnoseAttrStageMismatch | ( | const Attr * | A, |
llvm::Triple::EnvironmentType | Stage, | ||
std::initializer_list< llvm::Triple::EnvironmentType > | AllowedStages | ||
) |
Definition at line 448 of file SemaHLSL.cpp.
References clang::SemaBase::Diag(), and clang::AttributeCommonInfo::getLoc().
Referenced by CheckEntryPoint(), and CheckSemanticAnnotation().
void SemaHLSL::DiagnoseAvailabilityViolations | ( | TranslationUnitDecl * | TU | ) |
Definition at line 1656 of file SemaHLSL.cpp.
References clang::Sema::getASTContext(), clang::Sema::getLangOpts(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), and clang::SemaBase::SemaRef.
Referenced by clang::Sema::ActOnEndOfTranslationUnit().
bool SemaHLSL::diagnoseInputIDType | ( | QualType | T, |
const ParsedAttr & | AL | ||
) |
Definition at line 769 of file SemaHLSL.cpp.
References clang::SemaBase::Diag(), clang::Type::getAs(), clang::AttributeCommonInfo::getLoc(), clang::Type::hasUnsignedIntegerRepresentation(), and clang::T.
Referenced by handleSV_DispatchThreadIDAttr(), handleSV_GroupIDAttr(), and handleSV_GroupThreadIDAttr().
void SemaHLSL::emitLogicalOperatorFixIt | ( | Expr * | LHS, |
Expr * | RHS, | ||
BinaryOperatorKind | Opc | ||
) |
Definition at line 632 of file SemaHLSL.cpp.
References clang::FixItHint::CreateReplacement(), clang::SemaBase::Diag(), clang::Stmt::getBeginLoc(), clang::Stmt::getEndLoc(), clang::Sema::getLangOpts(), clang::Stmt::printPretty(), and clang::SemaBase::SemaRef.
Referenced by clang::Sema::CheckVectorLogicalOperands().
Definition at line 2483 of file SemaHLSL.cpp.
References clang::QualType::addRestrict(), clang::Sema::getASTContext(), clang::ASTContext::getLValueReferenceType(), clang::Type::isReferenceType(), and clang::SemaBase::SemaRef.
Referenced by GetFullTypeForDeclarator(), and instantiateDependentHLSLParamModifierAttr().
void SemaHLSL::handleNumThreadsAttr | ( | Decl * | D, |
const ParsedAttr & | AL | ||
) |
Definition at line 650 of file SemaHLSL.cpp.
References clang::Decl::addAttr(), clang::Sema::checkUInt32Argument(), D, clang::SemaBase::Diag(), clang::ParsedAttr::getArgAsExpr(), clang::SemaBase::getASTContext(), clang::Expr::getExprLoc(), clang::AttributeCommonInfo::getLoc(), clang::ASTContext::getTargetInfo(), clang::TargetInfo::getTriple(), mergeNumThreadsAttr(), clang::SemaBase::SemaRef, and X.
Referenced by ProcessDeclAttribute().
void SemaHLSL::handlePackOffsetAttr | ( | Decl * | D, |
const ParsedAttr & | AL | ||
) |
Definition at line 808 of file SemaHLSL.cpp.
References clang::Decl::addAttr(), clang::Sema::checkUInt32Argument(), D, clang::SemaBase::Diag(), clang::ParsedAttr::getArgAsExpr(), clang::Type::getAs(), clang::SemaBase::getASTContext(), clang::Decl::getDeclContext(), clang::AttributeCommonInfo::getLoc(), clang::ASTContext::getTypeAlign(), clang::ASTContext::getTypeSize(), clang::Type::isArrayType(), clang::Type::isStructureType(), clang::SemaBase::SemaRef, and clang::T.
Referenced by ProcessDeclAttribute().
void SemaHLSL::handleParamModifierAttr | ( | Decl * | D, |
const ParsedAttr & | AL | ||
) |
Definition at line 1306 of file SemaHLSL.cpp.
References clang::Decl::addAttr(), D, clang::ParsedAttr::getSemanticSpelling(), and mergeParamModifierAttr().
Referenced by ProcessDeclAttribute().
void SemaHLSL::handleResourceBindingAttr | ( | Decl * | D, |
const ParsedAttr & | AL | ||
) |
Definition at line 1224 of file SemaHLSL.cpp.
References clang::AANT_ArgumentIdentifier, clang::Decl::addAttr(), convertToRegisterType(), clang::SemaBase::Diag(), DiagnoseHLSLRegisterAttribute(), clang::ParsedAttr::getArgAsIdent(), clang::SemaBase::getASTContext(), clang::Decl::getBeginLoc(), clang::AttributeCommonInfo::getLoc(), clang::ParsedAttr::getNumArgs(), clang::ParsedAttr::isArgIdent(), Loc, clang::Sema::RequireCompleteType(), and clang::SemaBase::SemaRef.
Referenced by ProcessDeclAttribute().
bool SemaHLSL::handleResourceTypeAttr | ( | QualType | T, |
const ParsedAttr & | AL | ||
) |
Definition at line 961 of file SemaHLSL.cpp.
References clang::AANT_ArgumentIdentifier, clang::ParsedAttr::checkExactlyNumArgs(), clang::SemaBase::Diag(), clang::ParsedAttr::getArgAsIdent(), clang::SemaBase::getASTContext(), clang::TypeLoc::getBeginLoc(), clang::ParsedAttr::getKind(), clang::AttributeCommonInfo::getLoc(), clang::ParsedAttr::getMinArgs(), clang::ParsedAttr::getNumArgs(), clang::ParsedAttr::getTypeArg(), clang::Sema::GetTypeFromParser(), clang::TypeSourceInfo::getTypeLoc(), clang::ParsedAttr::hasParsedType(), Identifier, clang::ParsedAttr::isArgIdent(), Loc, clang::Sema::RequireCompleteType(), clang::SemaBase::SemaRef, and clang::T.
void SemaHLSL::handleShaderAttr | ( | Decl * | D, |
const ParsedAttr & | AL | ||
) |
Definition at line 857 of file SemaHLSL.cpp.
References clang::Decl::addAttr(), clang::Sema::checkStringLiteralArgumentAttr(), D, clang::SemaBase::Diag(), clang::AttributeCommonInfo::getLoc(), mergeShaderAttr(), and clang::SemaBase::SemaRef.
Referenced by ProcessDeclAttribute().
void SemaHLSL::handleSV_DispatchThreadIDAttr | ( | Decl * | D, |
const ParsedAttr & | AL | ||
) |
Definition at line 782 of file SemaHLSL.cpp.
References clang::Decl::addAttr(), D, diagnoseInputIDType(), and clang::SemaBase::getASTContext().
Referenced by ProcessDeclAttribute().
void SemaHLSL::handleSV_GroupIDAttr | ( | Decl * | D, |
const ParsedAttr & | AL | ||
) |
Definition at line 800 of file SemaHLSL.cpp.
References clang::Decl::addAttr(), D, diagnoseInputIDType(), and clang::SemaBase::getASTContext().
Referenced by ProcessDeclAttribute().
void SemaHLSL::handleSV_GroupThreadIDAttr | ( | Decl * | D, |
const ParsedAttr & | AL | ||
) |
Definition at line 791 of file SemaHLSL.cpp.
References clang::Decl::addAttr(), D, diagnoseInputIDType(), and clang::SemaBase::getASTContext().
Referenced by ProcessDeclAttribute().
QualType SemaHLSL::handleVectorBinOpConversion | ( | ExprResult & | LHS, |
ExprResult & | RHS, | ||
QualType | LHSType, | ||
QualType | RHSType, | ||
bool | IsCompAssign | ||
) |
Definition at line 565 of file SemaHLSL.cpp.
References clang::Type::castAs(), clang::SemaBase::Diag(), clang::ActionResult< PtrTy, Compress >::get(), clang::Type::getAs(), clang::SemaBase::getASTContext(), clang::Stmt::getBeginLoc(), clang::VectorType::getNumElements(), getScalarCastKind(), clang::Expr::getType(), handleFloatVectorBinOpConversion(), handleIntegerVectorBinOpConversion(), clang::Sema::ImpCastExprToType(), clang::Type::isIntegralType(), clang::Type::isRealFloatingType(), and clang::SemaBase::SemaRef.
Referenced by clang::Sema::CheckVectorOperands().
void SemaHLSL::handleWaveSizeAttr | ( | Decl * | D, |
const ParsedAttr & | AL | ||
) |
Definition at line 705 of file SemaHLSL.cpp.
References clang::Decl::addAttr(), clang::Sema::checkUInt32Argument(), D, clang::SemaBase::Diag(), clang::ParsedAttr::getArgAsExpr(), clang::Expr::getExprLoc(), clang::AttributeCommonInfo::getLoc(), clang::ParsedAttr::getNumArgs(), isValidWaveSizeValue(), clang::Max, mergeWaveSizeAttr(), clang::Min, and clang::SemaBase::SemaRef.
Referenced by ProcessDeclAttribute().
Definition at line 2370 of file SemaHLSL.cpp.
References BuildFlattenedTypeList(), clang::Sema::getASTContext(), clang::QualType::getCanonicalType(), clang::QualType::getUnqualifiedType(), clang::ASTContext::hasSameType(), clang::Sema::IsLayoutCompatible(), clang::QualType::isNull(), and clang::SemaBase::SemaRef.
bool SemaHLSL::IsTypedResourceElementCompatible | ( | clang::QualType | QT | ) |
Definition at line 2333 of file SemaHLSL.cpp.
References clang::Sema::Context, clang::Type::getAs(), clang::ASTContext::getTypeSize(), clang::Type::isArithmeticType(), clang::Type::isArrayType(), clang::Type::isBooleanType(), clang::Type::isEnumeralType(), clang::QualType::isNull(), clang::Type::isRecordType(), and clang::SemaBase::SemaRef.
HLSLNumThreadsAttr * SemaHLSL::mergeNumThreadsAttr | ( | Decl * | D, |
const AttributeCommonInfo & | AL, | ||
int | X, | ||
int | Y, | ||
int | Z | ||
) |
Definition at line 253 of file SemaHLSL.cpp.
References D, clang::SemaBase::Diag(), clang::SemaBase::getASTContext(), clang::Decl::getAttr(), clang::AttributeCommonInfo::getLoc(), and X.
Referenced by handleNumThreadsAttr(), and mergeDeclAttribute().
HLSLParamModifierAttr * SemaHLSL::mergeParamModifierAttr | ( | Decl * | D, |
const AttributeCommonInfo & | AL, | ||
HLSLParamModifierAttr::Spelling | Spelling | ||
) |
Definition at line 300 of file SemaHLSL.cpp.
References D, clang::SemaBase::Diag(), clang::Decl::dropAttr(), clang::SemaBase::getASTContext(), clang::Decl::getAttr(), clang::SourceRange::getEnd(), clang::AttributeCommonInfo::getLoc(), and clang::AttributeCommonInfo::getRange().
Referenced by handleParamModifierAttr().
HLSLShaderAttr * SemaHLSL::mergeShaderAttr | ( | Decl * | D, |
const AttributeCommonInfo & | AL, | ||
llvm::Triple::EnvironmentType | ShaderType | ||
) |
Definition at line 287 of file SemaHLSL.cpp.
References D, clang::SemaBase::Diag(), clang::SemaBase::getASTContext(), clang::Decl::getAttr(), and clang::AttributeCommonInfo::getLoc().
Referenced by handleShaderAttr(), and mergeDeclAttribute().
HLSLWaveSizeAttr * SemaHLSL::mergeWaveSizeAttr | ( | Decl * | D, |
const AttributeCommonInfo & | AL, | ||
int | Min, | ||
int | Max, | ||
int | Preferred, | ||
int | SpelledArgsCount | ||
) |
Definition at line 267 of file SemaHLSL.cpp.
References D, clang::SemaBase::Diag(), clang::SemaBase::getASTContext(), clang::Decl::getAttr(), clang::AttributeCommonInfo::getLoc(), clang::Max, clang::Min, and clang::Result.
Referenced by handleWaveSizeAttr(), and mergeDeclAttribute().
Definition at line 1030 of file SemaHLSL.cpp.
References clang::CreateHLSLAttributedResourceType(), clang::QualType::getTypePtr(), and clang::SemaBase::SemaRef.
Referenced by ConvertDeclSpecToType().
HLSLAttributedResourceLocInfo SemaHLSL::TakeLocForHLSLAttribute | ( | const HLSLAttributedResourceType * | RT | ) |
Definition at line 1053 of file SemaHLSL.cpp.
References clang::HLSLAttributedResourceLocInfo::Range.