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                                          bool *type_is_new_ptr) = 0;
32
33  virtual lldb_private::Function *
34  ParseFunctionFromDWARF(lldb_private::CompileUnit &comp_unit,
35                         const DWARFDIE &die) = 0;
36
37  virtual bool
38  CompleteTypeFromDWARF(const DWARFDIE &die, lldb_private::Type *type,
39                        lldb_private::CompilerType &compiler_type) = 0;
40
41  virtual lldb_private::CompilerDecl
42  GetDeclForUIDFromDWARF(const DWARFDIE &die) = 0;
43
44  virtual lldb_private::CompilerDeclContext
45  GetDeclContextForUIDFromDWARF(const DWARFDIE &die) = 0;
46
47  virtual lldb_private::CompilerDeclContext
48  GetDeclContextContainingUIDFromDWARF(const DWARFDIE &die) = 0;
49
50  virtual void EnsureAllDIEsInDeclContextHaveBeenParsed(
51      lldb_private::CompilerDeclContext decl_context) = 0;
52
53  static llvm::Optional<lldb_private::SymbolFile::ArrayInfo>
54  ParseChildArrayInfo(const DWARFDIE &parent_die,
55                      const lldb_private::ExecutionContext *exe_ctx = nullptr);
56};
57
58#endif // SymbolFileDWARF_DWARFASTParser_h_
59