1 //===-- ClangExpression.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 <string>
16 #include <map>
17 #include <vector>
18 
19 // Other libraries and framework includes
20 // Project includes
21 
22 #include "lldb/lldb-forward.h"
23 #include "lldb/lldb-private.h"
24 #include "lldb/Core/ClangForward.h"
25 #include "lldb/Expression/ExpressionTypeSystemHelper.h"
26 
27 namespace lldb_private {
28 
29 class RecordingMemoryManager;
30 
31 //----------------------------------------------------------------------
32 // ClangExpressionHelper
33 //----------------------------------------------------------------------
34 class ClangExpressionHelper : public ExpressionTypeSystemHelper
35 {
36 public:
37     static bool classof(const ExpressionTypeSystemHelper *ts)
38     {
39         return ts->getKind() == eKindClangHelper;
40     }
41 
42     ClangExpressionHelper () :
43         ExpressionTypeSystemHelper(ExpressionTypeSystemHelper::LLVMCastKind::eKindClangHelper)
44     {
45     }
46 
47     //------------------------------------------------------------------
48     /// Destructor
49     //------------------------------------------------------------------
50     virtual ~ClangExpressionHelper ()
51     {
52     }
53 
54     //------------------------------------------------------------------
55     /// Return the object that the parser should use when resolving external
56     /// values.  May be NULL if everything should be self-contained.
57     //------------------------------------------------------------------
58     virtual ClangExpressionDeclMap *
59     DeclMap () = 0;
60 
61     //------------------------------------------------------------------
62     /// Return the object that the parser should allow to access ASTs.
63     /// May be NULL if the ASTs do not need to be transformed.
64     ///
65     /// @param[in] passthrough
66     ///     The ASTConsumer that the returned transformer should send
67     ///     the ASTs to after transformation.
68     //------------------------------------------------------------------
69     virtual clang::ASTConsumer *
70     ASTTransformer(clang::ASTConsumer *passthrough) = 0;
71 
72     virtual void
73     CommitPersistentDecls()
74     {
75     }
76 
77 protected:
78 };
79 
80 } // namespace lldb_private
81 
82 #endif  // liblldb_ClangExpression_h_
83