File indexing completed on 2026-05-10 08:37:00
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012 #ifndef CLANG_SEMA_HLSLEXTERNALSEMASOURCE_H
0013 #define CLANG_SEMA_HLSLEXTERNALSEMASOURCE_H
0014
0015 #include "llvm/ADT/DenseMap.h"
0016
0017 #include "clang/Sema/ExternalSemaSource.h"
0018
0019 namespace clang {
0020 class NamespaceDecl;
0021 class Sema;
0022
0023 class HLSLExternalSemaSource : public ExternalSemaSource {
0024 Sema *SemaPtr = nullptr;
0025 NamespaceDecl *HLSLNamespace = nullptr;
0026
0027 using CompletionFunction = std::function<void(CXXRecordDecl *)>;
0028 llvm::DenseMap<CXXRecordDecl *, CompletionFunction> Completions;
0029
0030 void defineHLSLVectorAlias();
0031 void defineTrivialHLSLTypes();
0032 void defineHLSLTypesWithForwardDeclarations();
0033
0034 void onCompletion(CXXRecordDecl *Record, CompletionFunction Fn);
0035
0036 public:
0037 ~HLSLExternalSemaSource() override;
0038
0039
0040
0041
0042 void InitializeSema(Sema &S) override;
0043
0044
0045 void ForgetSema() override { SemaPtr = nullptr; }
0046
0047 using ExternalASTSource::CompleteType;
0048
0049 void CompleteType(TagDecl *Tag) override;
0050 };
0051
0052 }
0053
0054 #endif