LLVM 18.0.0git
Public Types | Public Member Functions | Static Public Member Functions | List of all members
llvm::dwarflinker_parallel::DWARFLinker Class Referenceabstract

#include "llvm/DWARFLinkerParallel/DWARFLinker.h"

Inheritance diagram for llvm::dwarflinker_parallel::DWARFLinker:
Inheritance graph
[legend]

Public Types

enum class  OutputFileType { Object , Assembly }
 Type of output file. More...
 
enum class  AccelTableKind : uint8_t { Apple , Pub , DebugNames }
 The kind of accelerator tables we should emit. 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 TranslatorFuncTy = std::function< StringRef(StringRef)>
 
using SwiftInterfacesMapTy = std::map< std::string, std::string >
 

Public Member Functions

virtual ~DWARFLinker ()=default
 
virtual Error createEmitter (const Triple &TheTriple, OutputFileType FileType, raw_pwrite_stream &OutFile)=0
 Creates emitter for output dwarf.
 
virtual ExtraDwarfEmittergetEmitter ()=0
 Returns previously created dwarf emitter. May be nullptr.
 
virtual void addObjectFile (DWARFFile &File, ObjFileLoaderTy Loader=nullptr, CompileUnitHandlerTy OnCUDieLoaded=[](const DWARFUnit &) {})=0
 Add object file to be linked.
 
virtual Error link ()=0
 Link debug info for added files.
 
virtual void setVerbosity (bool Verbose)=0
 Allows to generate log of linking process to the 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 UpdateIndexTablesOnly)=0
 Update index tables only(do not modify rest of DWARF).
 
virtual void setAllowNonDeterministicOutput (bool AllowNonDeterministicOutput)=0
 Allow generating valid, but non-deterministic output.
 
virtual void setKeepFunctionForStatic (bool KeepFunctionForStatic)=0
 Set 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 (const std::string &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 which would be 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.
 

Static Public Member Functions

static std::unique_ptr< DWARFLinkercreateLinker (MessageHandlerTy ErrorHandler, MessageHandlerTy WarningHandler, TranslatorFuncTy StringsTranslator=nullptr)
 Creates dwarf linker instance.
 

Detailed Description

Definition at line 114 of file DWARFLinker.h.

Member Typedef Documentation

◆ CompileUnitHandlerTy

Definition at line 135 of file DWARFLinker.h.

◆ InputVerificationHandlerTy

Definition at line 133 of file DWARFLinker.h.

◆ MessageHandlerTy

Definition at line 129 of file DWARFLinker.h.

◆ ObjectPrefixMapTy

using llvm::dwarflinker_parallel::DWARFLinker::ObjectPrefixMapTy = std::map<std::string, std::string>

Definition at line 134 of file DWARFLinker.h.

◆ ObjFileLoaderTy

Definition at line 131 of file DWARFLinker.h.

◆ SwiftInterfacesMapTy

using llvm::dwarflinker_parallel::DWARFLinker::SwiftInterfacesMapTy = std::map<std::string, std::string>

Definition at line 137 of file DWARFLinker.h.

◆ TranslatorFuncTy

Definition at line 136 of file DWARFLinker.h.

Member Enumeration Documentation

◆ AccelTableKind

The kind of accelerator tables we should emit.

Enumerator
Apple 

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

Pub 

.debug_pubnames, .debug_pubtypes

DebugNames 

.debug_names.

Definition at line 123 of file DWARFLinker.h.

◆ OutputFileType

Type of output file.

Enumerator
Object 
Assembly 

Definition at line 117 of file DWARFLinker.h.

Constructor & Destructor Documentation

◆ ~DWARFLinker()

virtual llvm::dwarflinker_parallel::DWARFLinker::~DWARFLinker ( )
virtualdefault

Member Function Documentation

◆ addObjectFile()

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

Add object file to be linked.

Pre-load compile unit die. Call OnCUDieLoaded for each compile unit die. If specified File has reference to the Clang module then such module would be pre-loaded by Loader for !Update case.

Precondition
NoODR, Update options should be set before call to addObjectFile.

Implemented in llvm::dwarflinker_parallel::DWARFLinkerImpl.

◆ createEmitter()

virtual Error llvm::dwarflinker_parallel::DWARFLinker::createEmitter ( const Triple TheTriple,
OutputFileType  FileType,
raw_pwrite_stream OutFile 
)
pure virtual

Creates emitter for output dwarf.

Implemented in llvm::dwarflinker_parallel::DWARFLinkerImpl.

◆ createLinker()

std::unique_ptr< llvm::dwarflinker_parallel::DWARFLinker > llvm::dwarflinker_parallel::DWARFLinker::createLinker ( MessageHandlerTy  ErrorHandler,
MessageHandlerTy  WarningHandler,
TranslatorFuncTy  StringsTranslator = nullptr 
)
static

Creates dwarf linker instance.

Definition at line 13 of file DWARFLinker.cpp.

References ErrorHandler.

◆ getEmitter()

virtual ExtraDwarfEmitter * llvm::dwarflinker_parallel::DWARFLinker::getEmitter ( )
pure virtual

Returns previously created dwarf emitter. May be nullptr.

Implemented in llvm::dwarflinker_parallel::DWARFLinkerImpl.

◆ link()

virtual Error llvm::dwarflinker_parallel::DWARFLinker::link ( )
pure virtual

Link debug info for added files.

Implemented in llvm::dwarflinker_parallel::DWARFLinkerImpl.


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