LLVM  14.0.0git
Classes | Public Member Functions | List of all members
llvm::DWARFLinker Class Reference

The core of the Dwarf linking logic. More...

#include "llvm/DWARFLinker/DWARFLinker.h"

Public Member Functions

 DWARFLinker (DwarfEmitter *Emitter, DwarfLinkerClient ClientID=DwarfLinkerClient::General)
 
void addObjectFile (DWARFFile &File)
 Add object file to be linked. More...
 
bool link ()
 Link debug info for added objFiles. More...
 
void setVerbosity (bool Verbose)
 A number of methods setting various linking options: More...
 
void setStatistics (bool Statistics)
 Print statistics to standard output. More...
 
void setNoOutput (bool NoOut)
 Do not emit linked dwarf info. More...
 
void setNoODR (bool NoODR)
 Do not unique types according to ODR. More...
 
void setUpdate (bool Update)
 update existing DWARF info(for the linked binary). More...
 
void setKeepFunctionForStatic (bool KeepFunctionForStatic)
 Set whether to keep the enclosing function for a static variable. More...
 
void setNumThreads (unsigned NumThreads)
 Use specified number of threads for parallel files linking. More...
 
void setAccelTableKind (AccelTableKind Kind)
 Set kind of accelerator tables to be generated. More...
 
void setPrependPath (const std::string &Ppath)
 Set prepend path for clang modules. More...
 
void setStringsTranslator (std::function< StringRef(StringRef)> StringsTranslator)
 Set translator which would be used for strings. More...
 
void setEstimatedObjfilesAmount (unsigned ObjFilesNum)
 Set estimated objects files amount, for preliminary data allocation. More...
 
void setWarningHandler (messageHandler Handler)
 Set warning handler which would be used to report warnings. More...
 
void setErrorHandler (messageHandler Handler)
 Set error handler which would be used to report errors. More...
 
void setObjFileLoader (objFileLoader Loader)
 Set object files loader which would be used to load additional objects for splitted dwarf. More...
 
void setSwiftInterfacesMap (swiftInterfacesMap *Map)
 Set map for Swift interfaces. More...
 
void setObjectPrefixMap (objectPrefixMap *Map)
 Set prefix map for objects. More...
 

Detailed Description

The core of the Dwarf linking logic.

The generation of the dwarf information from the object files will be driven by the selection of 'root DIEs', which are DIEs that describe variables or functions that resolves to the corresponding code section(and thus have entries in the Addresses map). All the debug information that will be generated(the DIEs, but also the line tables, ranges, ...) is derived from that set of root DIEs.

The root DIEs are identified because they contain relocations that points to code section(the low_pc for a function, the location for a variable). These relocations are called ValidRelocs in the AddressesInfo and are gathered as a very first step when we start processing a object file.

Definition at line 254 of file DWARFLinker.h.

Constructor & Destructor Documentation

◆ DWARFLinker()

llvm::DWARFLinker::DWARFLinker ( DwarfEmitter Emitter,
DwarfLinkerClient  ClientID = DwarfLinkerClient::General 
)
inline

Definition at line 256 of file DWARFLinker.h.

Member Function Documentation

◆ addObjectFile()

void llvm::DWARFLinker::addObjectFile ( DWARFFile File)

Add object file to be linked.

Definition at line 2310 of file DWARFLinker.cpp.

References File.

◆ link()

bool llvm::DWARFLinker::link ( )

◆ setAccelTableKind()

void llvm::DWARFLinker::setAccelTableKind ( AccelTableKind  Kind)
inline

Set kind of accelerator tables to be generated.

Definition at line 293 of file DWARFLinker.h.

◆ setErrorHandler()

void llvm::DWARFLinker::setErrorHandler ( messageHandler  Handler)
inline

Set error handler which would be used to report errors.

Definition at line 317 of file DWARFLinker.h.

◆ setEstimatedObjfilesAmount()

void llvm::DWARFLinker::setEstimatedObjfilesAmount ( unsigned  ObjFilesNum)
inline

Set estimated objects files amount, for preliminary data allocation.

Definition at line 307 of file DWARFLinker.h.

◆ setKeepFunctionForStatic()

void llvm::DWARFLinker::setKeepFunctionForStatic ( bool  KeepFunctionForStatic)
inline

Set whether to keep the enclosing function for a static variable.

Definition at line 285 of file DWARFLinker.h.

◆ setNoODR()

void llvm::DWARFLinker::setNoODR ( bool  NoODR)
inline

Do not unique types according to ODR.

Definition at line 279 of file DWARFLinker.h.

◆ setNoOutput()

void llvm::DWARFLinker::setNoOutput ( bool  NoOut)
inline

Do not emit linked dwarf info.

Definition at line 276 of file DWARFLinker.h.

◆ setNumThreads()

void llvm::DWARFLinker::setNumThreads ( unsigned  NumThreads)
inline

Use specified number of threads for parallel files linking.

Definition at line 290 of file DWARFLinker.h.

◆ setObjectPrefixMap()

void llvm::DWARFLinker::setObjectPrefixMap ( objectPrefixMap Map)
inline

Set prefix map for objects.

Definition at line 333 of file DWARFLinker.h.

◆ setObjFileLoader()

void llvm::DWARFLinker::setObjFileLoader ( objFileLoader  Loader)
inline

Set object files loader which would be used to load additional objects for splitted dwarf.

Definition at line 323 of file DWARFLinker.h.

◆ setPrependPath()

void llvm::DWARFLinker::setPrependPath ( const std::string &  Ppath)
inline

Set prepend path for clang modules.

Definition at line 298 of file DWARFLinker.h.

◆ setStatistics()

void llvm::DWARFLinker::setStatistics ( bool  Statistics)
inline

Print statistics to standard output.

Definition at line 273 of file DWARFLinker.h.

◆ setStringsTranslator()

void llvm::DWARFLinker::setStringsTranslator ( std::function< StringRef(StringRef)>  StringsTranslator)
inline

Set translator which would be used for strings.

Definition at line 302 of file DWARFLinker.h.

◆ setSwiftInterfacesMap()

void llvm::DWARFLinker::setSwiftInterfacesMap ( swiftInterfacesMap Map)
inline

Set map for Swift interfaces.

Definition at line 328 of file DWARFLinker.h.

◆ setUpdate()

void llvm::DWARFLinker::setUpdate ( bool  Update)
inline

update existing DWARF info(for the linked binary).

Definition at line 282 of file DWARFLinker.h.

◆ setVerbosity()

void llvm::DWARFLinker::setVerbosity ( bool  Verbose)
inline

A number of methods setting various linking options:

Allows to generate log of linking process to the standard output.

Definition at line 270 of file DWARFLinker.h.

References llvm::Verbose.

◆ setWarningHandler()

void llvm::DWARFLinker::setWarningHandler ( messageHandler  Handler)
inline

Set warning handler which would be used to report warnings.

Definition at line 312 of file DWARFLinker.h.


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