clang 24.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
16#include "llvm/ADT/DenseMap.h"
17
18namespace clang {
19class NamespaceDecl;
20class Sema;
21
23 Sema *SemaPtr = nullptr;
24 NamespaceDecl *HLSLNamespace = nullptr;
25 NamespaceDecl *HLSLDetailNamespace = nullptr;
26
27 using CompletionFunction = std::function<void(CXXRecordDecl *)>;
28 llvm::DenseMap<CXXRecordDecl *, CompletionFunction> Completions;
29
30public:
32
33 /// Initialize the semantic source with the Sema instance
34 /// being used to perform semantic analysis on the abstract syntax
35 /// tree.
36 void InitializeSema(Sema &S) override;
37
38 /// Inform the semantic consumer that Sema is no longer available.
39 void ForgetSema() override { SemaPtr = nullptr; }
40
42 /// Complete an incomplete HLSL builtin type
43 void CompleteType(TagDecl *Tag) override;
44
45private:
46 void defineTrivialHLSLTypes();
47 void defineInternalHLSLTypes();
48 void defineHLSLVectorAlias();
49 void defineHLSLMatrixAlias();
50 void defineHeapResourceInfoTypes();
51 void defineHLSLTypesWithForwardDeclarations();
52 void defineHLSLAtomicIntrinsics();
53 void onCompletion(CXXRecordDecl *Record, CompletionFunction Fn);
54};
55
56} // namespace clang
57
58#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.
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:593
Sema - This implements semantic analysis and AST building for C.
Definition Sema.h:863
Represents the declaration of a struct/union/class/enum.
Definition Decl.h:3852
Top level wrappers for InstallAPI frontend operations.
int const char * function
Definition c++config.h:31