clang 19.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 {
28
29class SemaHLSL : public SemaBase {
30public:
31 SemaHLSL(Sema &S);
32
33 Decl *ActOnStartBuffer(Scope *BufferScope, bool CBuffer, SourceLocation KwLoc,
34 IdentifierInfo *Ident, SourceLocation IdentLoc,
35 SourceLocation LBrace);
36 void ActOnFinishBuffer(Decl *Dcl, SourceLocation RBrace);
37 HLSLNumThreadsAttr *mergeNumThreadsAttr(Decl *D,
38 const AttributeCommonInfo &AL, int X,
39 int Y, int Z);
40 HLSLShaderAttr *mergeShaderAttr(Decl *D, const AttributeCommonInfo &AL,
41 HLSLShaderAttr::ShaderType ShaderType);
42 HLSLParamModifierAttr *
44 HLSLParamModifierAttr::Spelling Spelling);
47 void CheckSemanticAnnotation(FunctionDecl *EntryPoint, const Decl *Param,
48 const HLSLAnnotationAttr *AnnotationAttr);
50 const Attr *A, HLSLShaderAttr::ShaderType Stage,
51 std::initializer_list<HLSLShaderAttr::ShaderType> AllowedStages);
52};
53
54} // namespace clang
55
56#endif // LLVM_CLANG_SEMA_SEMAHLSL_H
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
Decl - This represents one declaration (or definition), e.g.
Definition: DeclBase.h:86
Represents a function declaration or definition.
Definition: Decl.h:1971
One of these records is kept for each identifier that is lexed.
Scope - A scope is a transient data structure that is used while parsing the program.
Definition: Scope.h:41
void CheckEntryPoint(FunctionDecl *FD)
Definition: SemaHLSL.cpp:130
HLSLNumThreadsAttr * mergeNumThreadsAttr(Decl *D, const AttributeCommonInfo &AL, int X, int Y, int Z)
Definition: SemaHLSL.cpp:48
void CheckSemanticAnnotation(FunctionDecl *EntryPoint, const Decl *Param, const HLSLAnnotationAttr *AnnotationAttr)
Definition: SemaHLSL.cpp:181
HLSLShaderAttr * mergeShaderAttr(Decl *D, const AttributeCommonInfo &AL, HLSLShaderAttr::ShaderType ShaderType)
Definition: SemaHLSL.cpp:63
void ActOnTopLevelFunction(FunctionDecl *FD)
Definition: SemaHLSL.cpp:96
void ActOnFinishBuffer(Decl *Dcl, SourceLocation RBrace)
Definition: SemaHLSL.cpp:42
HLSLParamModifierAttr * mergeParamModifierAttr(Decl *D, const AttributeCommonInfo &AL, HLSLParamModifierAttr::Spelling Spelling)
Definition: SemaHLSL.cpp:76
Decl * ActOnStartBuffer(Scope *BufferScope, bool CBuffer, SourceLocation KwLoc, IdentifierInfo *Ident, SourceLocation IdentLoc, SourceLocation LBrace)
Definition: SemaHLSL.cpp:27
void DiagnoseAttrStageMismatch(const Attr *A, HLSLShaderAttr::ShaderType Stage, std::initializer_list< HLSLShaderAttr::ShaderType > AllowedStages)
Definition: SemaHLSL.cpp:200
Sema - This implements semantic analysis and AST building for C.
Definition: Sema.h:457
Encodes a location in the source.
The JSON file list parser is used to communicate input to InstallAPI.