LLVM 24.0.0git
llvm::dwarf_linker::DWARFFile Class Reference

This class represents DWARF information for source file and it's address map. More...

#include "llvm/DWARFLinker/DWARFFile.h"

Public Types

using UnloadCallbackTy = std::function<void(StringRef FileName)>
using UnitOffsetsCallbackTy

Public Member Functions

 DWARFFile (StringRef Name, std::unique_ptr< DWARFContext > Dwarf, std::unique_ptr< AddressesMap > Addresses, UnloadCallbackTy UnloadFunc=nullptr)
std::string remapPath (StringRef Path) const
void unload ()
 Unloads object file and corresponding AddressesMap and Dwarf Context.

Public Attributes

StringRef FileName
 Object file name.
std::unique_ptr< DWARFContext > Dwarf
 Source DWARF information.
std::unique_ptr< AddressesMap > Addresses
 Helpful address information(list of valid address ranges, relocations).
UnloadCallbackTy UnloadFunc
 Callback to the module keeping object file to unload.
std::shared_ptr< PrefixMapper > PrefixMap
 Maps the path prefixes that the compiler remapped in this file's debug info back to the original ones.
UnitOffsetsCallbackTy UnitOffsetsFunc
 Reports where a unit landed in the output .debug_info and .debug_addr, for the relocations saved relative to it.

Detailed Description

This class represents DWARF information for source file and it's address map.

May be used asynchroniously for reading.

Definition at line 27 of file DWARFFile.h.

Member Typedef Documentation

◆ UnitOffsetsCallbackTy

Initial value:
std::function<void(uint64_t OriginalUnitOffset, uint64_t DebugInfoOffset,
uint64_t DebugAddrOffset)>
uint64_t uint64_t

Definition at line 31 of file DWARFFile.h.

◆ UnloadCallbackTy

Definition at line 29 of file DWARFFile.h.

Constructor & Destructor Documentation

◆ DWARFFile()

llvm::dwarf_linker::DWARFFile::DWARFFile ( StringRef Name,
std::unique_ptr< DWARFContext > Dwarf,
std::unique_ptr< AddressesMap > Addresses,
UnloadCallbackTy UnloadFunc = nullptr )
inline

Definition at line 35 of file DWARFFile.h.

References Addresses, Dwarf, FileName, llvm::move(), and UnloadFunc.

Member Function Documentation

◆ remapPath()

std::string llvm::dwarf_linker::DWARFFile::remapPath ( StringRef Path) const
inline
Returns
Path, a path from this file's debug info, with the prefix mapping undone. This is used both to locate build artifacts referenced by the debug info, such as Swift interfaces and Clang modules, and to restore the original paths in the linked debug info.

Definition at line 61 of file DWARFFile.h.

References PrefixMap.

◆ unload()

void llvm::dwarf_linker::DWARFFile::unload ( )
inline

Unloads object file and corresponding AddressesMap and Dwarf Context.

Definition at line 71 of file DWARFFile.h.

References Addresses, Dwarf, FileName, and UnloadFunc.

Member Data Documentation

◆ Addresses

std::unique_ptr<AddressesMap> llvm::dwarf_linker::DWARFFile::Addresses

Helpful address information(list of valid address ranges, relocations).

Definition at line 48 of file DWARFFile.h.

Referenced by llvm::dwarf_linker::parallel::CompileUnit::cloneDieAttrExpression(), DWARFFile(), and unload().

◆ Dwarf

std::unique_ptr<DWARFContext> llvm::dwarf_linker::DWARFFile::Dwarf

Source DWARF information.

Definition at line 45 of file DWARFFile.h.

Referenced by llvm::dwarf_linker::parallel::CompileUnit::cloneAndEmitLineTable(), DWARFFile(), and unload().

◆ FileName

StringRef llvm::dwarf_linker::DWARFFile::FileName

Object file name.

Definition at line 42 of file DWARFFile.h.

Referenced by DWARFFile(), and unload().

◆ PrefixMap

std::shared_ptr<PrefixMapper> llvm::dwarf_linker::DWARFFile::PrefixMap

Maps the path prefixes that the compiler remapped in this file's debug info back to the original ones.

Definition at line 55 of file DWARFFile.h.

Referenced by remapPath().

◆ UnitOffsetsFunc

UnitOffsetsCallbackTy llvm::dwarf_linker::DWARFFile::UnitOffsetsFunc

Reports where a unit landed in the output .debug_info and .debug_addr, for the relocations saved relative to it.

Unlike Addresses, it outlives unload(), as a linker may only place the units after unloading them.

Definition at line 68 of file DWARFFile.h.

Referenced by llvm::dwarf_linker::parallel::CompileUnit::reportUnitOffsets().

◆ UnloadFunc

UnloadCallbackTy llvm::dwarf_linker::DWARFFile::UnloadFunc

Callback to the module keeping object file to unload.

Definition at line 51 of file DWARFFile.h.

Referenced by DWARFFile(), and unload().


The documentation for this class was generated from the following file: