1 //===-- ClangExpressionHelper.h ---------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef liblldb_ClangExpression_h_
11 #define liblldb_ClangExpression_h_
12 
13 // C Includes
14 // C++ Includes
15 #include <map>
16 #include <string>
17 #include <vector>
18 
19 // Other libraries and framework includes
20 // Project includes
21 
22 #include "lldb/Core/ClangForward.h"
23 #include "lldb/Expression/ExpressionTypeSystemHelper.h"
24 #include "lldb/lldb-forward.h"
25 #include "lldb/lldb-private.h"
26 
27 namespace lldb_private {
28 
29 class RecordingMemoryManager;
30 
31 //----------------------------------------------------------------------
32 // ClangExpressionHelper
33 //----------------------------------------------------------------------
34 class ClangExpressionHelper : public ExpressionTypeSystemHelper {
35 public:
36   static bool classof(const ExpressionTypeSystemHelper *ts) {
37     return ts->getKind() == eKindClangHelper;
38   }
39 
40   ClangExpressionHelper()
41       : ExpressionTypeSystemHelper(
42             ExpressionTypeSystemHelper::LLVMCastKind::eKindClangHelper) {}
43 
44   //------------------------------------------------------------------
45   /// Destructor
46   //------------------------------------------------------------------
47   virtual ~ClangExpressionHelper() {}
48 
49   //------------------------------------------------------------------
50   /// Return the object that the parser should use when resolving external
51   /// values.  May be NULL if everything should be self-contained.
52   //------------------------------------------------------------------
53   virtual ClangExpressionDeclMap *DeclMap() = 0;
54 
55   //------------------------------------------------------------------
56   /// Return the object that the parser should allow to access ASTs.
57   /// May be NULL if the ASTs do not need to be transformed.
58   ///
59   /// @param[in] passthrough
60   ///     The ASTConsumer that the returned transformer should send
61   ///     the ASTs to after transformation.
62   //------------------------------------------------------------------
63   virtual clang::ASTConsumer *
64   ASTTransformer(clang::ASTConsumer *passthrough) = 0;
65 
66   virtual void CommitPersistentDecls() {}
67 
68 protected:
69 };
70 
71 } // namespace lldb_private
72 
73 #endif // liblldb_ClangExpression_h_
74