LLVM 20.0.0git
Public Types | Public Member Functions | List of all members
llvm::dwarf_linker::DWARFLinkerBase Class Referenceabstract

The base interface for DWARFLinker implementations. More...

#include "llvm/DWARFLinker/DWARFLinkerBase.h"

Inheritance diagram for llvm::dwarf_linker::DWARFLinkerBase:
Inheritance graph
[legend]

Public Types

enum class  OutputFileType : uint8_t { Object , Assembly }
 Type of output file. More...
 
enum class  AccelTableKind : uint8_t { Apple , Pub , DebugNames }
 The kind of accelerator tables to be emitted. More...
 
using MessageHandlerTy = std::function< void(const Twine &Warning, StringRef Context, const DWARFDie *DIE)>
 
using ObjFileLoaderTy = std::function< ErrorOr< DWARFFile & >(StringRef ContainerName, StringRef Path)>
 
using InputVerificationHandlerTy = std::function< void(const DWARFFile &File, llvm::StringRef Output)>
 
using ObjectPrefixMapTy = std::map< std::string, std::string >
 
using CompileUnitHandlerTy = function_ref< void(const DWARFUnit &Unit)>
 
using SwiftInterfacesMapTy = std::map< std::string, std::string >
 

Public Member Functions

virtual ~DWARFLinkerBase ()=default
 
virtual void addObjectFile (DWARFFile &File, ObjFileLoaderTy Loader=nullptr, CompileUnitHandlerTy OnCUDieLoaded=[](const DWARFUnit &) {})=0
 Add an object file to be linked.
 
virtual Error link ()=0
 Link the debug info for all object files added through calls to addObjectFile.
 
virtual void setVerbosity (bool Verbose)=0
 A number of methods setting various linking options: Enable logging to standard output.
 
virtual void setStatistics (bool Statistics)=0
 Print statistics to standard output.
 
virtual void setVerifyInputDWARF (bool Verify)=0
 Verify the input DWARF.
 
virtual void setNoODR (bool NoODR)=0
 Do not unique types according to ODR.
 
virtual void setUpdateIndexTablesOnly (bool Update)=0
 Update index tables only (do not modify rest of DWARF).
 
virtual void setAllowNonDeterministicOutput (bool)=0
 Allows generating non-deterministic output in exchange for more parallelism.
 
virtual void setKeepFunctionForStatic (bool KeepFunctionForStatic)=0
 Set whether to keep the enclosing function for a static variable.
 
virtual void setNumThreads (unsigned NumThreads)=0
 Use specified number of threads for parallel files linking.
 
virtual void addAccelTableKind (AccelTableKind Kind)=0
 Add kind of accelerator tables to be generated.
 
virtual void setPrependPath (StringRef Ppath)=0
 Set prepend path for clang modules.
 
virtual void setEstimatedObjfilesAmount (unsigned ObjFilesNum)=0
 Set estimated objects files amount, for preliminary data allocation.
 
virtual void setInputVerificationHandler (InputVerificationHandlerTy Handler)=0
 Set verification handler used to report verification errors.
 
virtual void setSwiftInterfacesMap (SwiftInterfacesMapTy *Map)=0
 Set map for Swift interfaces.
 
virtual void setObjectPrefixMap (ObjectPrefixMapTy *Map)=0
 Set prefix map for objects.
 
virtual Error setTargetDWARFVersion (uint16_t TargetDWARFVersion)=0
 Set target DWARF version.
 

Detailed Description

The base interface for DWARFLinker implementations.

Definition at line 74 of file DWARFLinkerBase.h.

Member Typedef Documentation

◆ CompileUnitHandlerTy

Definition at line 84 of file DWARFLinkerBase.h.

◆ InputVerificationHandlerTy

Definition at line 81 of file DWARFLinkerBase.h.

◆ MessageHandlerTy

Definition at line 77 of file DWARFLinkerBase.h.

◆ ObjectPrefixMapTy

using llvm::dwarf_linker::DWARFLinkerBase::ObjectPrefixMapTy = std::map<std::string, std::string>

Definition at line 83 of file DWARFLinkerBase.h.

◆ ObjFileLoaderTy

Definition at line 79 of file DWARFLinkerBase.h.

◆ SwiftInterfacesMapTy

using llvm::dwarf_linker::DWARFLinkerBase::SwiftInterfacesMapTy = std::map<std::string, std::string>

Definition at line 85 of file DWARFLinkerBase.h.

Member Enumeration Documentation

◆ AccelTableKind

The kind of accelerator tables to be emitted.

Enumerator
Apple 

.apple_names, .apple_namespaces, .apple_types, .apple_objc.

Pub 

.debug_pubnames, .debug_pubtypes

DebugNames 

.debug_names.

Definition at line 92 of file DWARFLinkerBase.h.

◆ OutputFileType

Type of output file.

Enumerator
Object 
Assembly 

Definition at line 87 of file DWARFLinkerBase.h.

Constructor & Destructor Documentation

◆ ~DWARFLinkerBase()

virtual llvm::dwarf_linker::DWARFLinkerBase::~DWARFLinkerBase ( )
virtualdefault

Member Function Documentation

◆ addAccelTableKind()

virtual void llvm::dwarf_linker::DWARFLinkerBase::addAccelTableKind ( AccelTableKind  Kind)
pure virtual

Add kind of accelerator tables to be generated.

Implemented in llvm::dwarf_linker::classic::DWARFLinker, and llvm::dwarf_linker::parallel::DWARFLinkerImpl.

◆ addObjectFile()

virtual void llvm::dwarf_linker::DWARFLinkerBase::addObjectFile ( DWARFFile File,
ObjFileLoaderTy  Loader = nullptr,
CompileUnitHandlerTy  OnCUDieLoaded = [](const DWARFUnit &) {} 
)
pure virtual

Add an object file to be linked.

Pre-load compile unit die. Call OnCUDieLoaded for each compile unit die. If File has reference to a Clang module and UpdateIndexTablesOnly == false then the module is be pre-loaded by Loader.

Precondition
a call to setNoODR(true) and/or setUpdateIndexTablesOnly(bool Update) must be made when required.

Implemented in llvm::dwarf_linker::classic::DWARFLinker, and llvm::dwarf_linker::parallel::DWARFLinkerImpl.

◆ link()

virtual Error llvm::dwarf_linker::DWARFLinkerBase::link ( )
pure virtual

Link the debug info for all object files added through calls to addObjectFile.

Implemented in llvm::dwarf_linker::classic::DWARFLinker, and llvm::dwarf_linker::parallel::DWARFLinkerImpl.

◆ setAllowNonDeterministicOutput()

virtual void llvm::dwarf_linker::DWARFLinkerBase::setAllowNonDeterministicOutput ( bool  )
pure virtual

Allows generating non-deterministic output in exchange for more parallelism.

Implemented in llvm::dwarf_linker::parallel::DWARFLinkerImpl, and llvm::dwarf_linker::classic::DWARFLinker.

◆ setEstimatedObjfilesAmount()

virtual void llvm::dwarf_linker::DWARFLinkerBase::setEstimatedObjfilesAmount ( unsigned  ObjFilesNum)
pure virtual

Set estimated objects files amount, for preliminary data allocation.

Implemented in llvm::dwarf_linker::classic::DWARFLinker, and llvm::dwarf_linker::parallel::DWARFLinkerImpl.

◆ setInputVerificationHandler()

virtual void llvm::dwarf_linker::DWARFLinkerBase::setInputVerificationHandler ( InputVerificationHandlerTy  Handler)
pure virtual

Set verification handler used to report verification errors.

Implemented in llvm::dwarf_linker::classic::DWARFLinker, and llvm::dwarf_linker::parallel::DWARFLinkerImpl.

◆ setKeepFunctionForStatic()

virtual void llvm::dwarf_linker::DWARFLinkerBase::setKeepFunctionForStatic ( bool  KeepFunctionForStatic)
pure virtual

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

Implemented in llvm::dwarf_linker::classic::DWARFLinker, and llvm::dwarf_linker::parallel::DWARFLinkerImpl.

◆ setNoODR()

virtual void llvm::dwarf_linker::DWARFLinkerBase::setNoODR ( bool  NoODR)
pure virtual

Do not unique types according to ODR.

Implemented in llvm::dwarf_linker::classic::DWARFLinker, and llvm::dwarf_linker::parallel::DWARFLinkerImpl.

◆ setNumThreads()

virtual void llvm::dwarf_linker::DWARFLinkerBase::setNumThreads ( unsigned  NumThreads)
pure virtual

Use specified number of threads for parallel files linking.

Implemented in llvm::dwarf_linker::classic::DWARFLinker, and llvm::dwarf_linker::parallel::DWARFLinkerImpl.

◆ setObjectPrefixMap()

virtual void llvm::dwarf_linker::DWARFLinkerBase::setObjectPrefixMap ( ObjectPrefixMapTy Map)
pure virtual

◆ setPrependPath()

virtual void llvm::dwarf_linker::DWARFLinkerBase::setPrependPath ( StringRef  Ppath)
pure virtual

Set prepend path for clang modules.

Implemented in llvm::dwarf_linker::classic::DWARFLinker, and llvm::dwarf_linker::parallel::DWARFLinkerImpl.

◆ setStatistics()

virtual void llvm::dwarf_linker::DWARFLinkerBase::setStatistics ( bool  Statistics)
pure virtual

Print statistics to standard output.

Implemented in llvm::dwarf_linker::classic::DWARFLinker, and llvm::dwarf_linker::parallel::DWARFLinkerImpl.

◆ setSwiftInterfacesMap()

virtual void llvm::dwarf_linker::DWARFLinkerBase::setSwiftInterfacesMap ( SwiftInterfacesMapTy Map)
pure virtual

◆ setTargetDWARFVersion()

virtual Error llvm::dwarf_linker::DWARFLinkerBase::setTargetDWARFVersion ( uint16_t  TargetDWARFVersion)
pure virtual

◆ setUpdateIndexTablesOnly()

virtual void llvm::dwarf_linker::DWARFLinkerBase::setUpdateIndexTablesOnly ( bool  Update)
pure virtual

Update index tables only (do not modify rest of DWARF).

Implemented in llvm::dwarf_linker::classic::DWARFLinker, and llvm::dwarf_linker::parallel::DWARFLinkerImpl.

◆ setVerbosity()

virtual void llvm::dwarf_linker::DWARFLinkerBase::setVerbosity ( bool  Verbose)
pure virtual

A number of methods setting various linking options: Enable logging to standard output.

Implemented in llvm::dwarf_linker::classic::DWARFLinker, and llvm::dwarf_linker::parallel::DWARFLinkerImpl.

◆ setVerifyInputDWARF()

virtual void llvm::dwarf_linker::DWARFLinkerBase::setVerifyInputDWARF ( bool  Verify)
pure virtual

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