#include "DWARFLinkerImpl.h"
#include "DIEGenerator.h"
#include "DependencyTracker.h"
#include "llvm/DWARFLinker/Utils.h"
#include "llvm/DebugInfo/DWARF/DWARFDebugAbbrev.h"
#include "llvm/Support/FormatVariadic.h"
#include "llvm/Support/Parallel.h"
#include "llvm/Support/ThreadPool.h"
usingnamespacellvm;
usingnamespacedwarf_linker;
usingnamespacedwarf_linker::parallel;
DWARFLinkerImpl::DWARFLinkerImpl(MessageHandlerTy ErrorHandler,
MessageHandlerTy WarningHandler)
: … { … }
DWARFLinkerImpl::LinkContext::LinkContext(LinkingGlobalData &GlobalData,
DWARFFile &File,
StringMap<uint64_t> &ClangModules,
std::atomic<size_t> &UniqueUnitID)
: … { … }
DWARFLinkerImpl::LinkContext::RefModuleUnit::RefModuleUnit(
DWARFFile &File, std::unique_ptr<CompileUnit> Unit)
: … { … }
DWARFLinkerImpl::LinkContext::RefModuleUnit::RefModuleUnit(
LinkContext::RefModuleUnit &&Other)
: … { … }
void DWARFLinkerImpl::LinkContext::addModulesCompileUnit(
LinkContext::RefModuleUnit &&Unit) { … }
void DWARFLinkerImpl::addObjectFile(DWARFFile &File, ObjFileLoaderTy Loader,
CompileUnitHandlerTy OnCUDieLoaded) { … }
void DWARFLinkerImpl::setEstimatedObjfilesAmount(unsigned ObjFilesNum) { … }
Error DWARFLinkerImpl::link() { … }
void DWARFLinkerImpl::verifyInput(const DWARFFile &File) { … }
Error DWARFLinkerImpl::validateAndUpdateOptions() { … }
static void resolveRelativeObjectPath(SmallVectorImpl<char> &Buf, DWARFDie CU) { … }
static uint64_t getDwoId(const DWARFDie &CUDie) { … }
static std::string
remapPath(StringRef Path,
const DWARFLinker::ObjectPrefixMapTy &ObjectPrefixMap) { … }
static std::string getPCMFile(const DWARFDie &CUDie,
DWARFLinker::ObjectPrefixMapTy *ObjectPrefixMap) { … }
std::pair<bool, bool> DWARFLinkerImpl::LinkContext::isClangModuleRef(
const DWARFDie &CUDie, std::string &PCMFile, unsigned Indent, bool Quiet) { … }
bool DWARFLinkerImpl::LinkContext::registerModuleReference(
const DWARFDie &CUDie, ObjFileLoaderTy Loader,
CompileUnitHandlerTy OnCUDieLoaded, unsigned Indent) { … }
Error DWARFLinkerImpl::LinkContext::loadClangModule(
ObjFileLoaderTy Loader, const DWARFDie &CUDie, const std::string &PCMFile,
CompileUnitHandlerTy OnCUDieLoaded, unsigned Indent) { … }
Error DWARFLinkerImpl::LinkContext::link(TypeUnit *ArtificialTypeUnit) { … }
void DWARFLinkerImpl::LinkContext::linkSingleCompileUnit(
CompileUnit &CU, TypeUnit *ArtificialTypeUnit,
enum CompileUnit::Stage DoUntilStage) { … }
Error DWARFLinkerImpl::LinkContext::emitInvariantSections() { … }
Error DWARFLinkerImpl::LinkContext::cloneAndEmitDebugFrame() { … }
void DWARFLinkerImpl::LinkContext::emitFDE(uint32_t CIEOffset,
uint32_t AddrSize, uint64_t Address,
StringRef FDEBytes,
SectionDescriptor &Section) { … }
void DWARFLinkerImpl::glueCompileUnitsAndWriteToTheOutput() { … }
void DWARFLinkerImpl::printStatistic() { … }
void DWARFLinkerImpl::assignOffsets() { … }
void DWARFLinkerImpl::assignOffsetsToStrings() { … }
void DWARFLinkerImpl::assignOffsetsToSections() { … }
void DWARFLinkerImpl::forEachOutputString(
function_ref<void(StringDestinationKind Kind, const StringEntry *String)>
StringHandler) { … }
void DWARFLinkerImpl::forEachObjectSectionsSet(
function_ref<void(OutputSections &)> SectionsSetHandler) { … }
void DWARFLinkerImpl::forEachCompileAndTypeUnit(
function_ref<void(DwarfUnit *CU)> UnitHandler) { … }
void DWARFLinkerImpl::forEachCompileUnit(
function_ref<void(CompileUnit *CU)> UnitHandler) { … }
void DWARFLinkerImpl::patchOffsetsAndSizes() { … }
void DWARFLinkerImpl::emitCommonSectionsAndWriteCompileUnitsToTheOutput() { … }
void DWARFLinkerImpl::emitStringSections() { … }
void DWARFLinkerImpl::emitAppleAcceleratorSections(const Triple &TargetTriple) { … }
void DWARFLinkerImpl::emitDWARFv5DebugNamesSection(const Triple &TargetTriple) { … }
void DWARFLinkerImpl::cleanupDataAfterDWARFOutputIsWritten() { … }
void DWARFLinkerImpl::writeCompileUnitsToTheOutput() { … }
void DWARFLinkerImpl::writeCommonSectionsToTheOutput() { … }