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