clang 20.0.0 (based on r547379) from build 12806354. Bug: http://b/379133546 Test: N/A Change-Id: I2eb8938af55d809de674be63cb30cf27e801862b Upstream-Commit: ad834e67b1105d15ef907f6255d4c96e8e733f57
69 lines
2.8 KiB
C++
69 lines
2.8 KiB
C++
//===----- SemaHLSL.h ----- Semantic Analysis for HLSL constructs ---------===//
|
|
//
|
|
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
|
|
// See https://llvm.org/LICENSE.txt for license information.
|
|
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
|
|
//
|
|
//===----------------------------------------------------------------------===//
|
|
/// \file
|
|
/// This file declares semantic analysis for HLSL constructs.
|
|
///
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
#ifndef LLVM_CLANG_SEMA_SEMAHLSL_H
|
|
#define LLVM_CLANG_SEMA_SEMAHLSL_H
|
|
|
|
#include "clang/AST/ASTFwd.h"
|
|
#include "clang/AST/Attr.h"
|
|
#include "clang/Basic/SourceLocation.h"
|
|
#include "clang/Sema/SemaBase.h"
|
|
#include "llvm/TargetParser/Triple.h"
|
|
#include <initializer_list>
|
|
|
|
namespace clang {
|
|
class AttributeCommonInfo;
|
|
class IdentifierInfo;
|
|
class ParsedAttr;
|
|
class Scope;
|
|
|
|
class SemaHLSL : public SemaBase {
|
|
public:
|
|
SemaHLSL(Sema &S);
|
|
|
|
Decl *ActOnStartBuffer(Scope *BufferScope, bool CBuffer, SourceLocation KwLoc,
|
|
IdentifierInfo *Ident, SourceLocation IdentLoc,
|
|
SourceLocation LBrace);
|
|
void ActOnFinishBuffer(Decl *Dcl, SourceLocation RBrace);
|
|
HLSLNumThreadsAttr *mergeNumThreadsAttr(Decl *D,
|
|
const AttributeCommonInfo &AL, int X,
|
|
int Y, int Z);
|
|
HLSLShaderAttr *mergeShaderAttr(Decl *D, const AttributeCommonInfo &AL,
|
|
llvm::Triple::EnvironmentType ShaderType);
|
|
HLSLParamModifierAttr *
|
|
mergeParamModifierAttr(Decl *D, const AttributeCommonInfo &AL,
|
|
HLSLParamModifierAttr::Spelling Spelling);
|
|
void ActOnTopLevelFunction(FunctionDecl *FD);
|
|
void CheckEntryPoint(FunctionDecl *FD);
|
|
void CheckSemanticAnnotation(FunctionDecl *EntryPoint, const Decl *Param,
|
|
const HLSLAnnotationAttr *AnnotationAttr);
|
|
void DiagnoseAttrStageMismatch(
|
|
const Attr *A, llvm::Triple::EnvironmentType Stage,
|
|
std::initializer_list<llvm::Triple::EnvironmentType> AllowedStages);
|
|
void DiagnoseAvailabilityViolations(TranslationUnitDecl *TU);
|
|
|
|
void handleNumThreadsAttr(Decl *D, const ParsedAttr &AL);
|
|
void handleSV_DispatchThreadIDAttr(Decl *D, const ParsedAttr &AL);
|
|
void handlePackOffsetAttr(Decl *D, const ParsedAttr &AL);
|
|
void handleShaderAttr(Decl *D, const ParsedAttr &AL);
|
|
void handleROVAttr(Decl *D, const ParsedAttr &AL);
|
|
void handleResourceClassAttr(Decl *D, const ParsedAttr &AL);
|
|
void handleResourceBindingAttr(Decl *D, const ParsedAttr &AL);
|
|
void handleParamModifierAttr(Decl *D, const ParsedAttr &AL);
|
|
|
|
bool CheckBuiltinFunctionCall(unsigned BuiltinID, CallExpr *TheCall);
|
|
};
|
|
|
|
} // namespace clang
|
|
|
|
#endif // LLVM_CLANG_SEMA_SEMAHLSL_H
|