Go to the documentation of this file.
9 #ifndef LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGEXPRESSIONPARSER_H
10 #define LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGEXPRESSIONPARSER_H
27 class CodeCompleteConsumer;
28 class CompilerInstance;
33 class IRExecutionUnit;
34 class TypeSystemClang;
67 bool generate_debug_info,
75 unsigned typed_pos)
override;
118 lldb::IRExecutionUnitSP &execution_unit_sp,
166 clang::CodeCompleteConsumer *completion =
nullptr,
167 unsigned completion_line = 0,
168 unsigned completion_column = 0);
170 std::unique_ptr<llvm::LLVMContext>
172 std::unique_ptr<clang::CompilerInstance>
174 std::unique_ptr<clang::CodeGenerator>
188 #endif // LLDB_SOURCE_PLUGINS_EXPRESSIONPARSER_CLANG_CLANGEXPRESSIONPARSER_H
unsigned ParseInternal(DiagnosticManager &diagnostic_manager, clang::CodeCompleteConsumer *completion=nullptr, unsigned completion_line=0, unsigned completion_column=0)
Parses the expression.
ExecutionPolicy
Expression execution policies.
std::string m_filename
File name used for the user expression.
LLDBPreprocessorCallbacks * m_pp_callbacks
Called when the preprocessor encounters module imports.
std::unique_ptr< TypeSystemClang > m_ast_context
std::unique_ptr< clang::CodeGenerator > m_code_generator
The Clang object that generates IR.
Status PrepareForExecution(lldb::addr_t &func_addr, lldb::addr_t &func_end, lldb::IRExecutionUnitSP &execution_unit_sp, ExecutionContext &exe_ctx, bool &can_interpret, lldb_private::ExecutionPolicy execution_policy) override
Ready an already-parsed expression for execution, possibly evaluating it statically.
std::string GetClangTargetABI(const ArchSpec &target_arch)
Returns a string representing current ABI.
unsigned Parse(DiagnosticManager &diagnostic_manager)
Parse a single expression and convert it to IR using Clang.
bool RewriteExpression(DiagnosticManager &diagnostic_manager) override
Try to use the FixIts in the diagnostic_manager to rewrite the expression.
string(SUBSTRING ${p} 10 -1 pStripped) if($
bool Complete(CompletionRequest &request, unsigned line, unsigned pos, unsigned typed_pos) override
Attempts to find possible command line completions for the given expression.
std::vector< std::string > m_include_directories
std::unique_ptr< llvm::LLVMContext > m_llvm_context
The LLVM context to generate IR into.
include_directories(${CMAKE_CURRENT_SOURCE_DIR}) include_directories($
std::unique_ptr< clang::CompilerInstance > m_compiler
The Clang compiler used to parse expressions into IR.
~ClangExpressionParser() override
Destructor.
A class that represents a running process on the host machine.
ClangExpressionParser(ExecutionContextScope *exe_scope, Expression &expr, bool generate_debug_info, std::vector< std::string > include_directories={}, std::string filename="<clang expression>")
Constructor.
Status RunStaticInitializers(lldb::IRExecutionUnitSP &execution_unit_sp, ExecutionContext &exe_ctx)
Run all static initializers for an execution unit.