clang 20.0.0git
SemaHLSL.h
Go to the documentation of this file.
1//===----- SemaHLSL.h ----- Semantic Analysis for HLSL constructs ---------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8/// \file
9/// This file declares semantic analysis for HLSL constructs.
10///
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_CLANG_SEMA_SEMAHLSL_H
14#define LLVM_CLANG_SEMA_SEMAHLSL_H
15
16#include "clang/AST/Attr.h"
17#include "clang/AST/Decl.h"
18#include "clang/AST/DeclBase.h"
19#include "clang/AST/Expr.h"
23#include "clang/Sema/Scope.h"
24#include "clang/Sema/SemaBase.h"
25#include <initializer_list>
26
27namespace clang {
28class ParsedAttr;
29
30class SemaHLSL : public SemaBase {
31public:
32 SemaHLSL(Sema &S);
33
34 Decl *ActOnStartBuffer(Scope *BufferScope, bool CBuffer, SourceLocation KwLoc,
35 IdentifierInfo *Ident, SourceLocation IdentLoc,
36 SourceLocation LBrace);
37 void ActOnFinishBuffer(Decl *Dcl, SourceLocation RBrace);
38 HLSLNumThreadsAttr *mergeNumThreadsAttr(Decl *D,
39 const AttributeCommonInfo &AL, int X,
40 int Y, int Z);
41 HLSLShaderAttr *mergeShaderAttr(Decl *D, const AttributeCommonInfo &AL,
42 llvm::Triple::EnvironmentType ShaderType);
43 HLSLParamModifierAttr *
45 HLSLParamModifierAttr::Spelling Spelling);
48 void CheckSemanticAnnotation(FunctionDecl *EntryPoint, const Decl *Param,
49 const HLSLAnnotationAttr *AnnotationAttr);
51 const Attr *A, llvm::Triple::EnvironmentType Stage,
52 std::initializer_list<llvm::Triple::EnvironmentType> AllowedStages);
54
55 void handleNumThreadsAttr(Decl *D, const ParsedAttr &AL);
57 void handlePackOffsetAttr(Decl *D, const ParsedAttr &AL);
58 void handleShaderAttr(Decl *D, const ParsedAttr &AL);
59 void handleResourceClassAttr(Decl *D, const ParsedAttr &AL);
61 void handleParamModifierAttr(Decl *D, const ParsedAttr &AL);
62
63 bool CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall);
64};
65
66} // namespace clang
67
68#endif // LLVM_CLANG_SEMA_SEMAHLSL_H
const Decl * D
Defines the clang::IdentifierInfo, clang::IdentifierTable, and clang::Selector interfaces.
#define X(type, name)
Definition: Value.h:143
Defines the clang::SourceLocation class and associated facilities.
Attr - This represents one attribute.
Definition: Attr.h:42
CallExpr - Represents a function call (C99 6.5.2.2, C++ [expr.call]).
Definition: Expr.h:2830
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
Represents a function declaration or definition.
Definition: Decl.h:1932
One of these records is kept for each identifier that is lexed.
ParsedAttr - Represents a syntactic attribute.
Definition: ParsedAttr.h:129
Scope - A scope is a transient data structure that is used while parsing the program.
Definition: Scope.h:41
void handleResourceClassAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaHLSL.cpp:440
void DiagnoseAttrStageMismatch(const Attr *A, llvm::Triple::EnvironmentType Stage, std::initializer_list< llvm::Triple::EnvironmentType > AllowedStages)
Definition: SemaHLSL.cpp:286
void handleShaderAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaHLSL.cpp:420
void handleSV_DispatchThreadIDAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaHLSL.cpp:359
void CheckEntryPoint(FunctionDecl *FD)
Definition: SemaHLSL.cpp:214
HLSLNumThreadsAttr * mergeNumThreadsAttr(Decl *D, const AttributeCommonInfo &AL, int X, int Y, int Z)
Definition: SemaHLSL.cpp:133
void handlePackOffsetAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaHLSL.cpp:371
void CheckSemanticAnnotation(FunctionDecl *EntryPoint, const Decl *Param, const HLSLAnnotationAttr *AnnotationAttr)
Definition: SemaHLSL.cpp:267
void handleParamModifierAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaHLSL.cpp:533
void handleResourceBindingAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaHLSL.cpp:462
void handleNumThreadsAttr(Decl *D, const ParsedAttr &AL)
Definition: SemaHLSL.cpp:300
void DiagnoseAvailabilityViolations(TranslationUnitDecl *TU)
Definition: SemaHLSL.cpp:884
void ActOnTopLevelFunction(FunctionDecl *FD)
Definition: SemaHLSL.cpp:181
HLSLShaderAttr * mergeShaderAttr(Decl *D, const AttributeCommonInfo &AL, llvm::Triple::EnvironmentType ShaderType)
Definition: SemaHLSL.cpp:148
void ActOnFinishBuffer(Decl *Dcl, SourceLocation RBrace)
Definition: SemaHLSL.cpp:82
HLSLParamModifierAttr * mergeParamModifierAttr(Decl *D, const AttributeCommonInfo &AL, HLSLParamModifierAttr::Spelling Spelling)
Definition: SemaHLSL.cpp:161
Decl * ActOnStartBuffer(Scope *BufferScope, bool CBuffer, SourceLocation KwLoc, IdentifierInfo *Ident, SourceLocation IdentLoc, SourceLocation LBrace)
Definition: SemaHLSL.cpp:32
bool CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall)
Definition: SemaHLSL.cpp:1015
Sema - This implements semantic analysis and AST building for C.
Definition: Sema.h:535
Encodes a location in the source.
The top declaration context.
Definition: Decl.h:84
The JSON file list parser is used to communicate input to InstallAPI.