xref: /openbsd-src/gnu/llvm/lldb/source/Plugins/ExpressionParser/Clang/ClangExpressionHelper.h (revision be691f3bb6417f04a68938fadbcaee2d5795e764)
1061da546Spatrick //===-- ClangExpressionHelper.h ---------------------------------*- C++ -*-===//
2061da546Spatrick //
3061da546Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4061da546Spatrick // See https://llvm.org/LICENSE.txt for license information.
5061da546Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6061da546Spatrick //
7061da546Spatrick //===----------------------------------------------------------------------===//
8061da546Spatrick 
9dda28197Spatrick #ifndef LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGEXPRESSIONHELPER_H
10dda28197Spatrick #define LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGEXPRESSIONHELPER_H
11061da546Spatrick 
12061da546Spatrick #include <map>
13061da546Spatrick #include <string>
14061da546Spatrick #include <vector>
15061da546Spatrick 
16061da546Spatrick #include "lldb/Expression/ExpressionTypeSystemHelper.h"
17061da546Spatrick #include "lldb/lldb-forward.h"
18061da546Spatrick #include "lldb/lldb-private.h"
19061da546Spatrick 
20dda28197Spatrick namespace clang {
21dda28197Spatrick class ASTConsumer;
22dda28197Spatrick }
23dda28197Spatrick 
24061da546Spatrick namespace lldb_private {
25061da546Spatrick 
26dda28197Spatrick class ClangExpressionDeclMap;
27061da546Spatrick class RecordingMemoryManager;
28061da546Spatrick 
29061da546Spatrick // ClangExpressionHelper
30061da546Spatrick class ClangExpressionHelper : public ExpressionTypeSystemHelper {
31061da546Spatrick public:
classof(const ExpressionTypeSystemHelper * ts)32061da546Spatrick   static bool classof(const ExpressionTypeSystemHelper *ts) {
33061da546Spatrick     return ts->getKind() == eKindClangHelper;
34061da546Spatrick   }
35061da546Spatrick 
ClangExpressionHelper()36061da546Spatrick   ClangExpressionHelper()
37061da546Spatrick       : ExpressionTypeSystemHelper(
38061da546Spatrick             ExpressionTypeSystemHelper::LLVMCastKind::eKindClangHelper) {}
39061da546Spatrick 
40061da546Spatrick   /// Destructor
41*be691f3bSpatrick   virtual ~ClangExpressionHelper() = default;
42061da546Spatrick 
43061da546Spatrick   /// Return the object that the parser should use when resolving external
44061da546Spatrick   /// values.  May be NULL if everything should be self-contained.
45061da546Spatrick   virtual ClangExpressionDeclMap *DeclMap() = 0;
46061da546Spatrick 
47061da546Spatrick   /// Return the object that the parser should allow to access ASTs.
48061da546Spatrick   /// May be NULL if the ASTs do not need to be transformed.
49061da546Spatrick   ///
50061da546Spatrick   /// \param[in] passthrough
51061da546Spatrick   ///     The ASTConsumer that the returned transformer should send
52061da546Spatrick   ///     the ASTs to after transformation.
53061da546Spatrick   virtual clang::ASTConsumer *
54061da546Spatrick   ASTTransformer(clang::ASTConsumer *passthrough) = 0;
55061da546Spatrick 
CommitPersistentDecls()56061da546Spatrick   virtual void CommitPersistentDecls() {}
57061da546Spatrick 
58061da546Spatrick protected:
59061da546Spatrick };
60061da546Spatrick 
61061da546Spatrick } // namespace lldb_private
62061da546Spatrick 
63dda28197Spatrick #endif // LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGEXPRESSIONHELPER_H
64