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 "clang/Sema/ExternalSemaSource.h"
16 
17 namespace clang {
18 class NamespaceDecl;
19 class Sema;
20 
21 class HLSLExternalSemaSource : public ExternalSemaSource {
22   Sema *SemaPtr = nullptr;
23   NamespaceDecl *HLSLNamespace;
24 
25   void defineHLSLVectorAlias();
26 
27 public:
28   ~HLSLExternalSemaSource() override;
29 
30   /// Initialize the semantic source with the Sema instance
31   /// being used to perform semantic analysis on the abstract syntax
32   /// tree.
33   void InitializeSema(Sema &S) override;
34 
35   /// Inform the semantic consumer that Sema is no longer available.
36   void ForgetSema() override { SemaPtr = nullptr; }
37 };
38 
39 } // namespace clang
40 
41 #endif // CLANG_SEMA_HLSLEXTERNALSEMASOURCE_H
42