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