1 //===-- ClangExpressionHelper.h ---------------------------------*- 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 #ifndef liblldb_ClangExpression_h_
10 #define liblldb_ClangExpression_h_
11 
12 #include <map>
13 #include <string>
14 #include <vector>
15 
16 #include "lldb/Expression/ExpressionTypeSystemHelper.h"
17 #include "lldb/lldb-forward.h"
18 #include "lldb/lldb-private.h"
19 
20 namespace clang {
21 class ASTConsumer;
22 }
23 
24 namespace lldb_private {
25 
26 class RecordingMemoryManager;
27 
28 // ClangExpressionHelper
29 class ClangExpressionHelper : public ExpressionTypeSystemHelper {
30 public:
31   static bool classof(const ExpressionTypeSystemHelper *ts) {
32     return ts->getKind() == eKindClangHelper;
33   }
34 
35   ClangExpressionHelper()
36       : ExpressionTypeSystemHelper(
37             ExpressionTypeSystemHelper::LLVMCastKind::eKindClangHelper) {}
38 
39   /// Destructor
40   virtual ~ClangExpressionHelper() {}
41 
42   /// Return the object that the parser should use when resolving external
43   /// values.  May be NULL if everything should be self-contained.
44   virtual ClangExpressionDeclMap *DeclMap() = 0;
45 
46   /// Return the object that the parser should allow to access ASTs.
47   /// May be NULL if the ASTs do not need to be transformed.
48   ///
49   /// \param[in] passthrough
50   ///     The ASTConsumer that the returned transformer should send
51   ///     the ASTs to after transformation.
52   virtual clang::ASTConsumer *
53   ASTTransformer(clang::ASTConsumer *passthrough) = 0;
54 
55   virtual void CommitPersistentDecls() {}
56 
57 protected:
58 };
59 
60 } // namespace lldb_private
61 
62 #endif // liblldb_ClangExpression_h_
63