clang 20.0.0git
HLSLExternalSemaSource.h
Go to the documentation of this file.
1//===--- HLSLExternalSemaSource.h - HLSL Sema Source ------------*- C++ -*-===//
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//
9// This file defines the HLSLExternalSemaSource interface.
10//
11//===----------------------------------------------------------------------===//
12#ifndef CLANG_SEMA_HLSLEXTERNALSEMASOURCE_H
13#define CLANG_SEMA_HLSLEXTERNALSEMASOURCE_H
14
15#include "llvm/ADT/DenseMap.h"
16
18
19namespace clang {
20class NamespaceDecl;
21class Sema;
22
24 Sema *SemaPtr = nullptr;
25 NamespaceDecl *HLSLNamespace = nullptr;
26
27 using CompletionFunction = std::function<void(CXXRecordDecl *)>;
28 llvm::DenseMap<CXXRecordDecl *, CompletionFunction> Completions;
29
30 void defineHLSLVectorAlias();
31 void defineTrivialHLSLTypes();
32 void defineHLSLTypesWithForwardDeclarations();
33
34 void onCompletion(CXXRecordDecl *Record, CompletionFunction Fn);
35
36public:
37 ~HLSLExternalSemaSource() override;
38
39 /// Initialize the semantic source with the Sema instance
40 /// being used to perform semantic analysis on the abstract syntax
41 /// tree.
42 void InitializeSema(Sema &S) override;
43
44 /// Inform the semantic consumer that Sema is no longer available.
45 void ForgetSema() override { SemaPtr = nullptr; }
46
48 /// Complete an incomplete HLSL builtin type
49 void CompleteType(TagDecl *Tag) override;
50};
51
52} // namespace clang
53
54#endif // CLANG_SEMA_HLSLEXTERNALSEMASOURCE_H
llvm::MachO::Record Record
Definition: MachO.h:31
Represents a C++ struct/union/class.
Definition: DeclCXX.h:258
virtual void CompleteType(TagDecl *Tag)
Gives the external AST source an opportunity to complete an incomplete type.
An abstract interface that should be implemented by external AST sources that also provide informatio...
void CompleteType(TagDecl *Tag) override
Complete an incomplete HLSL builtin type.
void ForgetSema() override
Inform the semantic consumer that Sema is no longer available.
void InitializeSema(Sema &S) override
Initialize the semantic source with the Sema instance being used to perform semantic analysis on the ...
Represent a C++ namespace.
Definition: Decl.h:547
Sema - This implements semantic analysis and AST building for C.
Definition: Sema.h:493
Represents the declaration of a struct/union/class/enum.
Definition: Decl.h:3561
The JSON file list parser is used to communicate input to InstallAPI.