DWARFASTParser.h revision 353358
1//===-- DWARFASTParser.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 SymbolFileDWARF_DWARFASTParser_h_
10#define SymbolFileDWARF_DWARFASTParser_h_
11
12#include "DWARFDefines.h"
13#include "lldb/Core/PluginInterface.h"
14#include "lldb/Symbol/SymbolFile.h"
15#include "lldb/Symbol/CompilerDecl.h"
16#include "lldb/Symbol/CompilerDeclContext.h"
17
18class DWARFDIE;
19namespace lldb_private {
20class CompileUnit;
21class ExecutionContext;
22}
23class SymbolFileDWARF;
24
25class DWARFASTParser {
26public:
27  virtual ~DWARFASTParser() {}
28
29  virtual lldb::TypeSP ParseTypeFromDWARF(const lldb_private::SymbolContext &sc,
30                                          const DWARFDIE &die,
31                                          lldb_private::Log *log,
32                                          bool *type_is_new_ptr) = 0;
33
34  virtual lldb_private::Function *
35  ParseFunctionFromDWARF(lldb_private::CompileUnit &comp_unit,
36                         const DWARFDIE &die) = 0;
37
38  virtual bool
39  CompleteTypeFromDWARF(const DWARFDIE &die, lldb_private::Type *type,
40                        lldb_private::CompilerType &compiler_type) = 0;
41
42  virtual lldb_private::CompilerDecl
43  GetDeclForUIDFromDWARF(const DWARFDIE &die) = 0;
44
45  virtual lldb_private::CompilerDeclContext
46  GetDeclContextForUIDFromDWARF(const DWARFDIE &die) = 0;
47
48  virtual lldb_private::CompilerDeclContext
49  GetDeclContextContainingUIDFromDWARF(const DWARFDIE &die) = 0;
50
51  virtual std::vector<DWARFDIE>
52  GetDIEForDeclContext(lldb_private::CompilerDeclContext decl_context) = 0;
53
54  static llvm::Optional<lldb_private::SymbolFile::ArrayInfo>
55  ParseChildArrayInfo(const DWARFDIE &parent_die,
56                      const lldb_private::ExecutionContext *exe_ctx = nullptr);
57};
58
59#endif // SymbolFileDWARF_DWARFASTParser_h_
60