LLVM 18.0.0git
DWARFFile.h
Go to the documentation of this file.
1//===- DWARFFile.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 LLVM_DWARFLINKERPARALLEL_DWARFFILE_H
10#define LLVM_DWARFLINKERPARALLEL_DWARFFILE_H
11
12#include "llvm/ADT/StringRef.h"
15#include "llvm/Support/Endian.h"
16#include <functional>
17#include <memory>
18
19namespace llvm {
20namespace dwarflinker_parallel {
21
22/// This class represents DWARF information for source file
23/// and it's address map.
24///
25/// May be used asynchroniously for reading.
26class DWARFFile {
27public:
28 using UnloadCallbackTy = std::function<void(StringRef FileName)>;
29
30 DWARFFile(StringRef Name, std::unique_ptr<DWARFContext> Dwarf,
31 std::unique_ptr<AddressesMap> Addresses,
33
34 /// Object file name.
36
37 /// Source DWARF information.
38 std::unique_ptr<DWARFContext> Dwarf;
39
40 /// Helpful address information(list of valid address ranges, relocations).
41 std::unique_ptr<AddressesMap> Addresses;
42
43 /// Callback to the module keeping object file to unload.
45
46 /// Unloads object file and corresponding AddressesMap and Dwarf Context.
47 void unload() {
48 Addresses.reset();
49 Dwarf.reset();
50
51 if (UnloadFunc)
53 }
54};
55
56} // end namespace dwarflinker_parallel
57} // end namespace llvm
58
59#endif // LLVM_DWARFLINKERPARALLEL_DWARFFILE_H
std::string Name
StringRef - Represent a constant reference to a string, i.e.
Definition: StringRef.h:50
This class represents DWARF information for source file and it's address map.
Definition: DWARFFile.h:26
std::unique_ptr< DWARFContext > Dwarf
Source DWARF information.
Definition: DWARFFile.h:38
UnloadCallbackTy UnloadFunc
Callback to the module keeping object file to unload.
Definition: DWARFFile.h:44
std::function< void(StringRef FileName)> UnloadCallbackTy
Definition: DWARFFile.h:28
StringRef FileName
Object file name.
Definition: DWARFFile.h:35
void unload()
Unloads object file and corresponding AddressesMap and Dwarf Context.
Definition: DWARFFile.h:47
std::unique_ptr< AddressesMap > Addresses
Helpful address information(list of valid address ranges, relocations).
Definition: DWARFFile.h:41
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18