Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions clang/include/clang/Sema/HLSLExternalSemaSource.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,15 @@ class NamespaceDecl;
class Sema;

class HLSLExternalSemaSource : public ExternalSemaSource {
private:
Sema *SemaPtr = nullptr;
NamespaceDecl *HLSLNamespace = nullptr;

using CompletionFunction = std::function<void(CXXRecordDecl *)>;
llvm::DenseMap<CXXRecordDecl *, CompletionFunction> Completions;

void defineHLSLVectorAlias();
void defineTrivialHLSLTypes();
void defineHLSLTypesWithForwardDeclarations();

void onCompletion(CXXRecordDecl *Record, CompletionFunction Fn);

public:
~HLSLExternalSemaSource() override;
~HLSLExternalSemaSource() override {}

/// Initialize the semantic source with the Sema instance
/// being used to perform semantic analysis on the abstract syntax
Expand All @@ -47,6 +42,12 @@ class HLSLExternalSemaSource : public ExternalSemaSource {
using ExternalASTSource::CompleteType;
/// Complete an incomplete HLSL builtin type
void CompleteType(TagDecl *Tag) override;

private:
void defineTrivialHLSLTypes();
void defineHLSLVectorAlias();
void defineHLSLTypesWithForwardDeclarations();
void onCompletion(CXXRecordDecl *Record, CompletionFunction Fn);
};

} // namespace clang
Expand Down
1 change: 1 addition & 0 deletions clang/lib/Sema/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ add_clang_library(clangSema
DeclSpec.cpp
DelayedDiagnostic.cpp
HeuristicResolver.cpp
HLSLBuiltinTypeDeclBuilder.cpp
HLSLExternalSemaSource.cpp
IdentifierResolver.cpp
JumpDiagnostics.cpp
Expand Down
Loading
Loading