37    if (!File.Dwarf->compile_units().empty())
 
   38      CompileUnits.reserve(File.Dwarf->getNumCompileUnits());
 
   41    Format.Version = File.Dwarf->getMaxVersion();
 
   42    Format.AddrSize = File.Dwarf->getCUAddrSize();
 
   43    Endianness = File.Dwarf->isLittleEndian() ? llvm::endianness::little
 
   44                                              : llvm::endianness::big;
 
 
   67    for (
const std::unique_ptr<DWARFUnit> &
CU :
 
   78      if (!
GlobalData.getOptions().UpdateIndexTablesOnly)
 
 
  100  if (std::optional<std::reference_wrapper<const Triple>> CurTriple =
 
  102    GlobalEndianness = (*CurTriple).get().isLittleEndian()
 
  106  std::optional<uint16_t> Language;
 
  109    if (Context->InputDWARFFile.Dwarf == 
nullptr) {
 
  110      Context->setOutputFormat(Context->getFormParams(), GlobalEndianness);
 
  115      outs() << 
"DEBUG MAP OBJECT: " << Context->InputDWARFFile.FileName
 
  118      for (
const std::unique_ptr<DWARFUnit> &OrigCU :
 
  119           Context->InputDWARFFile.Dwarf->compile_units()) {
 
  120        outs() << 
"Input compilation unit:";
 
  124        OrigCU->getUnitDIE().dump(
outs(), 0, DumpOpts);
 
  133      GlobalEndianness = Context->getEndianness();
 
  135        std::max(GlobalFormat.
AddrSize, Context->getFormParams().AddrSize);
 
  137    Context->setOutputFormat(Context->getFormParams(), GlobalEndianness);
 
  142    for (
const std::unique_ptr<DWARFUnit> &OrigCU :
 
  143         Context->InputDWARFFile.Dwarf->compile_units()) {
 
  144      DWARFDie UnitDie = OrigCU->getUnitDIE();
 
  147        if (std::optional<DWARFFormValue> Val =
 
  148                UnitDie.
find(dwarf::DW_AT_language)) {
 
  158    if (std::optional<std::reference_wrapper<const Triple>> TargetTriple =
 
  160      GlobalFormat.
AddrSize = (*TargetTriple).get().isArch32Bit() ? 4 : 8;
 
  167  if (!
GlobalData.Options.NoODR && Language.has_value()) {
 
  187        GlobalData.error(std::move(Err), Context->InputDWARFFile.FileName);
 
  189      Context->InputDWARFFile.unload();
 
  197          GlobalData.error(std::move(Err), Context->InputDWARFFile.FileName);
 
  199        Context->InputDWARFFile.unload();
 
  209                                            ->Children.empty()) {
 
 
  231    if (
GlobalData.getOptions().InputVerificationHandler)
 
  232      GlobalData.getOptions().InputVerificationHandler(File, OS.
str());
 
 
  237  if (
GlobalData.getOptions().TargetDWARFVersion == 0)
 
  239                             "target DWARF version is not set");
 
  244        "set number of threads to 1 to make --verbose to work properly.", 
"");
 
  248  if (
GlobalData.getOptions().UpdateIndexTablesOnly &&
 
 
  263      CUDie.
find({dwarf::DW_AT_dwo_id, dwarf::DW_AT_GNU_dwo_id}));
 
 
  272  if (ObjectPrefixMap.empty())
 
  276  for (
const auto &Entry : ObjectPrefixMap)
 
  279  return p.str().str();
 
 
  285      CUDie.
find({dwarf::DW_AT_dwo_name, dwarf::DW_AT_GNU_dwo_name}), 
"");
 
  291    PCMFile = 
remapPath(PCMFile, *ObjectPrefixMap);
 
 
  297    const DWARFDie &CUDie, std::string &PCMFile, 
unsigned Indent, 
bool Quiet) {
 
  299    return std::make_pair(
false, 
false);
 
  307      GlobalData.warn(
"anonymous module skeleton CU for " + PCMFile + 
".",
 
  309    return std::make_pair(
true, 
true);
 
  314    outs() << 
"Found clang module reference " << PCMFile;
 
  322    if (!
Quiet && 
GlobalData.getOptions().Verbose && (Cached->second != DwoId))
 
  324          Twine(
"hash mismatch: this object file was built against a " 
  325                "different version of the module ") +
 
  329      outs() << 
" [cached].\n";
 
  330    return std::make_pair(
true, 
true);
 
  333  return std::make_pair(
true, 
false);
 
 
  345  std::string PCMFile =
 
  347  std::pair<bool, bool> IsClangModuleRef =
 
  350  if (!IsClangModuleRef.first)
 
  353  if (IsClangModuleRef.second)
 
 
  386  if (Loader == 
nullptr) {
 
  387    GlobalData.error(
"cann't load clang module: loader is not specified.",
 
  396  std::unique_ptr<CompileUnit> Unit;
 
  397  for (
const auto &
CU : ErrOrObj->Dwarf->compile_units()) {
 
  400    auto ChildCUDie = 
CU->getUnitDIE();
 
  407             ": Clang modules are expected to have exactly 1 compile unit.\n");
 
  415      if (PCMDwoId != DwoId) {
 
  418              Twine(
"hash mismatch: this object file was built against a " 
  419                    "different version of the module ") +
 
  427      if (!ChildCUDie.hasChildren())
 
  431      Unit = std::make_unique<CompileUnit>(
 
 
  462  if (!
GlobalData.getOptions().UpdateIndexTablesOnly &&
 
  465      outs() << 
"No valid relocations found. Skipping.\n";
 
  473  for (
const auto &OrigCU : 
InputDWARFFile.Dwarf->compile_units()) {
 
  475    auto CUDie = OrigCU->getUnitDIE();
 
  476    std::string PCMFile =
 
  481    if (!CUDie || 
GlobalData.getOptions().UpdateIndexTablesOnly ||
 
  483      CompileUnits.emplace_back(std::make_unique<CompileUnit>(
 
  509            if (
CU->isInterconnectedCU()) {
 
  510              CU->maybeResetToLoadedStage();
 
  538      if (
CU->isInterconnectedCU() &&
 
  568  if (
GlobalData.getOptions().UpdateIndexTablesOnly) {
 
  582        ResultErr = std::move(Err);
 
 
  597        if (
CU.getStage() >= DoUntilStage)
 
  600        switch (
CU.getStage()) {
 
  604          if (!
CU.loadInputDIEs()) {
 
  609            CU.analyzeDWARFStructure();
 
  617                    CU.getOrigUnit().getUnitDIE(), 
nullptr,
 
  631                   "Flag indicating new inter-connections is not set");
 
  640            if (
CU.updateDependenciesCompleteness())
 
  645                  return CU.updateDependenciesCompleteness();
 
  647              return std::move(Err);
 
  655          CU.verifyDependencies();
 
  661              return std::move(Err);
 
  668          if (
CU.isClangModule() ||
 
  669              GlobalData.getOptions().UpdateIndexTablesOnly ||
 
  670              CU.getContaingFile().Addresses->hasValidRelocs()) {
 
  673              return std::move(Err);
 
  681          CU.updateDieRefPatchesWithClonedOffsets();
 
  687          CU.cleanupDataAfterClonning();
 
  702    CU.error(std::move(Err));
 
  703    CU.cleanupDataAfterClonning();
 
 
  709  if (!
GlobalData.getTargetTriple().has_value())
 
 
  731  if (!
GlobalData.getTargetTriple().has_value())
 
  740  if (OrigFrameData.
empty())
 
  744  for (std::unique_ptr<CompileUnit> &Unit : 
CompileUnits) {
 
  745    for (
auto CurRange : Unit->getFunctionRanges())
 
  746      AllUnitsRanges.
insert(CurRange.Range, CurRange.Value);
 
  765  while (
Data.isValidOffset(InputOffset)) {
 
  768    if (InitialLength == 0xFFFFFFFF)
 
  771                                               "Dwarf64 bits no supported"));
 
  774    if (CIEId == 0xFFFFFFFF) {
 
  776      StringRef CIEData = OrigFrameData.
substr(EntryOffset, InitialLength + 4);
 
  777      LocalCIES[EntryOffset] = CIEData;
 
  779      InputOffset += InitialLength - 4;
 
  789    std::optional<AddressRangeValuePair> 
Range =
 
  793      InputOffset = EntryOffset + InitialLength + 4;
 
  804                            "Inconsistent debug_frame content. Dropping."));
 
  810    auto IteratorInserted =
 
  811        EmittedCIEs.
insert(std::make_pair(CIEData, OffsetToCIERecord));
 
  812    OffsetToCIERecord = IteratorInserted.first->getValue();
 
  815    if (IteratorInserted.second)
 
  816      OutSection.
OS << CIEData;
 
  823    OutSection.notePatch(
 
  829    unsigned FDERemainingBytes = InitialLength - (4 + SrcAddrSize);
 
  831            OrigFrameData.
substr(InputOffset, FDERemainingBytes), OutSection);
 
  832    InputOffset += FDERemainingBytes;
 
 
  845  Section.emitIntVal(FDEBytes.
size() + 4 + AddrSize, 4);
 
  846  Section.emitIntVal(CIEOffset, 4);
 
  847  Section.emitIntVal(
Address, AddrSize);
 
  848  Section.OS.write(FDEBytes.
data(), FDEBytes.
size());
 
 
  852  if (!
GlobalData.getTargetTriple().has_value())
 
 
  885  for (
const std::unique_ptr<LinkContext> &Context : 
ObjectContexts) {
 
  886    uint64_t AllDebugInfoSectionsSize = 0;
 
  888    for (std::unique_ptr<CompileUnit> &
CU : Context->CompileUnits)
 
  889      if (std::optional<SectionDescriptor *> 
DebugInfo =
 
  891        AllDebugInfoSectionsSize += (*DebugInfo)->getContents().size();
 
  893    auto &
Size = SizeByObject[Context->InputDWARFFile.FileName];
 
  894    Size.Input = Context->OriginalDebugInfoSize;
 
  895    Size.Output = AllDebugInfoSectionsSize;
 
  899  std::vector<std::pair<StringRef, DebugInfoSize>> Sorted;
 
  900  for (
auto &E : SizeByObject)
 
  901    Sorted.emplace_back(E.first(), E.second);
 
  903    return LHS.second.Output > RHS.second.Output;
 
  906  auto ComputePercentange = [](int64_t 
Input, int64_t Output) -> 
float {
 
  907    const float Difference = Output - 
Input;
 
  908    const float Sum = 
Input + Output;
 
  911    return (Difference / (Sum / 2));
 
  914  int64_t InputTotal = 0;
 
  915  int64_t OutputTotal = 0;
 
  916  const char *FormatStr = 
"{0,-45} {1,10}b  {2,10}b {3,8:P}\n";
 
  919  outs() << 
".debug_info section size (in bytes)\n";
 
  920  outs() << 
"----------------------------------------------------------------" 
  922  outs() << 
"Filename                                           Object       " 
  924  outs() << 
"----------------------------------------------------------------" 
  928  for (
auto &E : Sorted) {
 
  929    InputTotal += E.second.Input;
 
  930    OutputTotal += E.second.Output;
 
  933        E.second.Output, ComputePercentange(E.second.Input, E.second.Output));
 
  936  outs() << 
"----------------------------------------------------------------" 
  939                          ComputePercentange(InputTotal, OutputTotal));
 
  940  outs() << 
"----------------------------------------------------------------" 
  941            "---------------\n\n";
 
 
  951  size_t CurDebugStrIndex = 1; 
 
  954  size_t CurDebugLineStrIndex = 0;
 
  966      if (!Entry->isIndexed()) {
 
  967        Entry->Offset = CurDebugStrOffset;
 
  968        CurDebugStrOffset += Entry->String.size() + 1;
 
  969        Entry->Index = CurDebugStrIndex++;
 
  977      if (!Entry->isIndexed()) {
 
  978        Entry->Offset = CurDebugLineStrOffset;
 
  979        CurDebugLineStrOffset += Entry->String.size() + 1;
 
  980        Entry->Index = CurDebugLineStrIndex++;
 
 
  988  std::array<uint64_t, SectionKindsNum> SectionSizesAccumulator = {0};
 
 
 1005      OutSection.ListDebugStrPatch.forEach([&](
DebugStrPatch &Patch) {
 
 1015      StringHandler(
DebugStr, Info.String);
 
 1021      OutSection.ListDebugStrPatch.forEach([&](
DebugStrPatch &Patch) {
 
 1030        if (Patch.Die == 
nullptr)
 
 1036      OutSection.ListDebugTypeLineStrPatch.forEach(
 
 1038            if (Patch.Die == 
nullptr)
 
 
 1054  for (
const std::unique_ptr<LinkContext> &Context : 
ObjectContexts)
 
 1057        SectionsSetHandler(*ModuleUnit.
Unit);
 
 1060  for (
const std::unique_ptr<LinkContext> &Context : 
ObjectContexts) {
 
 1062    SectionsSetHandler(*Context);
 
 1065    for (std::unique_ptr<CompileUnit> &
CU : Context->CompileUnits)
 
 1067        SectionsSetHandler(*
CU);
 
 
 1077  for (
const std::unique_ptr<LinkContext> &Context : 
ObjectContexts)
 
 1080        UnitHandler(ModuleUnit.
Unit.get());
 
 1083  for (
const std::unique_ptr<LinkContext> &Context : 
ObjectContexts)
 
 1084    for (std::unique_ptr<CompileUnit> &
CU : Context->CompileUnits)
 
 1086        UnitHandler(
CU.get());
 
 
 1092  for (
const std::unique_ptr<LinkContext> &Context : 
ObjectContexts)
 
 1095        UnitHandler(ModuleUnit.
Unit.get());
 
 1098  for (
const std::unique_ptr<LinkContext> &Context : 
ObjectContexts)
 
 1099    for (std::unique_ptr<CompileUnit> &
CU : Context->CompileUnits)
 
 1101        UnitHandler(
CU.get());
 
 
 1161  uint64_t DebugLineStrNextOffset = 0;
 
 1166      .emitInplaceString(
"");
 
 1167  DebugStrNextOffset++;
 
 1180          if (StringToEmit->
Offset >= DebugStrNextOffset) {
 
 1181            DebugStrNextOffset =
 
 1185                .emitInplaceString(StringToEmit->
String);
 
 1196          if (StringToEmit->
Offset >= DebugLineStrNextOffset) {
 
 1197            DebugLineStrNextOffset =
 
 1201                .emitInplaceString(StringToEmit->
String);
 
 
 1216      uint64_t OutOffset = Info.OutOffset;
 
 1217      switch (Info.Type) {
 
 1247            Info.QualifiedNameHash);
 
 1261    if (
Error Err = 
Emitter.init(TargetTriple, 
"__DWARF")) {
 
 1282    if (
Error Err = 
Emitter.init(TargetTriple, 
"__DWARF")) {
 
 1303    if (
Error Err = 
Emitter.init(TargetTriple, 
"__DWARF")) {
 
 1324    if (
Error Err = 
Emitter.init(TargetTriple, 
"__DWARF")) {
 
 
 1339  std::unique_ptr<DWARF5AccelTable> 
DebugNames;
 
 1347    bool HasRecords = 
false;
 
 1350        DebugNames = std::make_unique<DWARF5AccelTable>();
 
 1353      switch (Info.Type) {
 
 1358                            Info.OutOffset, std::nullopt ,
 
 1359                            Info.Tag, 
CU->getUniqueID(),
 
 1360                            CU->getTag() == dwarf::DW_TAG_type_unit);
 
 1369      CompUnits.push_back(
 
 1372      CUidToIdx[
CU->getUniqueID()] = Id++;
 
 1384    if (
Error Err = 
Emitter.init(TargetTriple, 
"__DWARF")) {
 
 
 1407    Sections.
forEach([&](std::shared_ptr<SectionDescriptor> OutSection) {
 
 
 1415  CommonSections.forEach([&](std::shared_ptr<SectionDescriptor> OutSection) {
 
 
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
 
dxil DXContainer Global Emitter
 
static fatal_error_handler_t ErrorHandler
 
ConstantRange Range(APInt(BitWidth, Low), APInt(BitWidth, High))
 
This class holds an abstract representation of an Accelerator Table, consisting of a sequence of buck...
 
std::optional< T > getRangeThatContains(uint64_t Addr) const
 
void insert(AddressRange Range, int64_t Value)
 
Utility class that carries the DWARF compile/type unit and the debug info entry in an object.
 
LLVM_ABI std::optional< DWARFFormValue > find(dwarf::Attribute Attr) const
Extract the specified attribute from this DIE.
 
virtual bool isLittleEndian() const =0
 
virtual StringRef getFileName() const
 
virtual const DWARFSection & getFrameSection() const
 
virtual uint8_t getAddressSize() const
 
Lightweight error class with error context and mandatory checking.
 
static ErrorSuccess success()
Create a success value.
 
Tagged union holding either a T or a Error.
 
void wait() override
Blocking wait for all the tasks to execute first.
 
SmallString - A SmallString is just a SmallVector with methods and accessors that make it work better...
 
This class consists of common code factored out of the SmallVector class to reduce code duplication b...
 
StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...
 
bool insert(MapEntryTy *KeyValue)
insert - Insert the specified key/value pair into the map.
 
StringRef - Represent a constant reference to a string, i.e.
 
constexpr StringRef substr(size_t Start, size_t N=npos) const
Return a reference to the substring from [Start, Start + N).
 
constexpr bool empty() const
empty - Check if the string is empty.
 
constexpr size_t size() const
size - Get the string size.
 
constexpr const char * data() const
data - Get a pointer to the start of the string (which may not be null terminated).
 
auto async(Function &&F, Args &&...ArgList)
Asynchronous submission of a task to the pool.
 
Triple - Helper class for working with autoconf configuration names.
 
Twine - A lightweight data structure for efficiently representing the concatenation of temporary valu...
 
This class represents DWARF information for source file and it's address map.
 
std::map< std::string, std::string > ObjectPrefixMapTy
 
function_ref< void(const DWARFUnit &Unit)> CompileUnitHandlerTy
 
std::function< void( const Twine &Warning, StringRef Context, const DWARFDie *DIE)> MessageHandlerTy
 
@ DebugNames
.debug_names.
 
@ Apple
.apple_names, .apple_namespaces, .apple_types, .apple_objc.
 
std::function< ErrorOr< DWARFFile & >( StringRef ContainerName, StringRef Path)> ObjFileLoaderTy
 
Stores all information related to a compile unit, be it in its original instance of the object file o...
 
Stage
The stages of new compile unit processing.
 
@ Cloned
Output DWARF is generated.
 
@ TypeNamesAssigned
Type names assigned to DIEs.
 
@ CreatedNotLoaded
Created, linked with input DWARF file.
 
@ PatchesUpdated
Offsets inside patch records are updated.
 
@ Cleaned
Resources(Input DWARF, Output DWARF tree) are released.
 
@ Loaded
Input DWARF is loaded.
 
@ LivenessAnalysisDone
Input DWARF is analysed(DIEs pointing to the real code section arediscovered, type names are assigned...
 
@ UpdateDependenciesCompleteness
Check if dependencies have incompatible placement.
 
@ Skipped
Compile Unit should be skipped.
 
void forEachObjectSectionsSet(function_ref< void(OutputSections &SectionsSet)> SectionsSetHandler)
Enumerates sections for modules, invariant for object files, compile units.
 
void emitDWARFv5DebugNamesSection(const Triple &TargetTriple)
Emit .debug_names section.
 
void writeCompileUnitsToTheOutput()
Enumerate all compile units and put their data into the output stream.
 
void forEachCompileUnit(function_ref< void(CompileUnit *CU)> UnitHandler)
Enumerates all comple units.
 
void assignOffsetsToStrings()
Enumerate all compile units and assign offsets to their strings.
 
void assignOffsets()
Enumerate all compile units and assign offsets to their sections and strings.
 
Error link() override
Link debug info for added files.
 
Error validateAndUpdateOptions()
Validate specified options.
 
void writeCommonSectionsToTheOutput()
Enumerate common sections and put their data into the output stream.
 
void assignOffsetsToSections()
Enumerate all compile units and assign offsets to their sections.
 
void printStatistic()
Print statistic for processed Debug Info.
 
void glueCompileUnitsAndWriteToTheOutput()
Take already linked compile units and glue them into single file.
 
void emitAppleAcceleratorSections(const Triple &TargetTriple)
Emit apple accelerator sections.
 
void verifyInput(const DWARFFile &File)
Verify input DWARF file.
 
void forEachCompileAndTypeUnit(function_ref< void(DwarfUnit *CU)> UnitHandler)
Enumerates all compile and type units.
 
void emitStringSections()
Emit string sections.
 
DWARFLinkerImpl(MessageHandlerTy ErrorHandler, MessageHandlerTy WarningHandler)
 
void addObjectFile(DWARFFile &File, ObjFileLoaderTy Loader=nullptr, CompileUnitHandlerTy OnCUDieLoaded=[](const DWARFUnit &) {}) override
Add object file to be linked.
 
void cleanupDataAfterDWARFOutputIsWritten()
Cleanup data(string pools) after output sections are generated.
 
void forEachOutputString(function_ref< void(StringDestinationKind, const StringEntry *)> StringHandler)
Enumerates all strings.
 
void emitCommonSectionsAndWriteCompileUnitsToTheOutput()
Emit debug sections common for all input files.
 
void patchOffsetsAndSizes()
Enumerates all patches and update them with the correct values.
 
This class emits DWARF data to the output stream.
 
Base class for all Dwarf units(Compile unit/Type table unit).
 
This class keeps data and services common for the whole linking process.
 
This class keeps contents and offsets to the debug sections.
 
void applyPatches(SectionDescriptor &Section, StringEntryToDwarfStringPoolEntryMap &DebugStrStrings, StringEntryToDwarfStringPoolEntryMap &DebugLineStrStrings, TypeUnit *TypeUnitPtr)
Enumerate all sections, for each section apply all section patches.
 
OutputSections(LinkingGlobalData &GlobalData)
 
LinkingGlobalData & GlobalData
 
void forEach(function_ref< void(SectionDescriptor &)> Handler)
Enumerate all sections and call Handler for each.
 
llvm::endianness getEndianness() const
Endiannes for the sections.
 
SectionDescriptor & getOrCreateSectionDescriptor(DebugSectionKind SectionKind)
Returns descriptor for the specified section of SectionKind.
 
void assignSectionsOffsetAndAccumulateSize(std::array< uint64_t, SectionKindsNum > &SectionSizesAccumulator)
Enumerate all sections, for each section set current offset (kept by SectionSizesAccumulator),...
 
Type Unit is used to represent an artificial compilation unit which keeps all type information.
 
An efficient, type-erasing, non-owning reference to a callable.
 
LLVM_ABI void spawn(std::function< void()> f)
 
uint64_t tell() const
tell - Return the current offset with the file.
 
raw_ostream & indent(unsigned NumSpaces)
indent - Insert 'NumSpaces' spaces.
 
A raw_ostream that writes to an std::string.
 
std::string & str()
Returns the string's reference.
 
LinkingGlobalData GlobalData
 
std::atomic< size_t > UniqueUnitID
Unique ID for compile unit.
 
uint64_t OverallNumberOfCU
Overall compile units number.
 
SmallVector< std::unique_ptr< LinkContext > > ObjectContexts
Keeps all linking contexts.
 
StringEntryToDwarfStringPoolEntryMap DebugLineStrStrings
DwarfStringPoolEntries for .debug_line_str section.
 
SectionHandlerTy SectionHandler
Hanler for output sections.
 
std::unique_ptr< TypeUnit > ArtificialTypeUnit
Type unit.
 
StringEntryToDwarfStringPoolEntryMap DebugStrStrings
DwarfStringPoolEntries for .debug_str section.
 
OutputSections CommonSections
Common sections.
 
StringMap< uint64_t > ClangModules
Mapping the PCM filename to the DwoId.
 
void setEstimatedObjfilesAmount(unsigned ObjFilesNum) override
Set estimated objects files amount, for preliminary data allocation.
 
#define llvm_unreachable(msg)
Marks that the current location is not supposed to be reachable.
 
bool isODRLanguage(uint16_t Language)
 
std::vector< std::variant< MCSymbol *, uint64_t > > DebugNamesUnitsOffsets
 
DenseMap< unsigned, unsigned > CompUnitIDToIdx
 
StringMapEntry< EmptyStringSetTag > StringEntry
StringEntry keeps data of the string: the length, external offset and a string body which is placed r...
 
Error finiteLoop(function_ref< Expected< bool >()> Iteration, size_t MaxCounter=100000)
This function calls Iteration() until it returns false.
 
AddressRangesMap RangesTy
Mapped value in the address map is the offset to apply to the linked address.
 
std::optional< const char * > toString(const std::optional< DWARFFormValue > &V)
Take an optional DWARFFormValue and try to extract a string value from it.
 
@ DW_FLAG_type_implementation
 
std::optional< uint64_t > toUnsigned(const std::optional< DWARFFormValue > &V)
Take an optional DWARFFormValue and try to extract an unsigned constant.
 
LLVM_ABI ThreadPoolStrategy strategy
 
LLVM_ABI bool is_relative(const Twine &path, Style style=Style::native)
Is path relative?
 
LLVM_ABI StringRef filename(StringRef path LLVM_LIFETIME_BOUND, Style style=Style::native)
Get filename.
 
LLVM_ABI bool replace_path_prefix(SmallVectorImpl< char > &Path, StringRef OldPrefix, StringRef NewPrefix, Style style=Style::native)
Replace matching path prefix with another path.
 
LLVM_ABI void append(SmallVectorImpl< char > &path, const Twine &a, const Twine &b="", const Twine &c="", const Twine &d="")
Append to path.
 
This is an optimization pass for GlobalISel generic memory operations.
 
ThreadPoolStrategy hardware_concurrency(unsigned ThreadCount=0)
Returns a default thread strategy where all available hardware resources are to be used,...
 
Error createFileError(const Twine &F, Error E)
Concatenate a source file path and/or name with an Error.
 
LLVM_ABI std::error_code inconvertibleErrorCode()
The value returned by this function can be returned from convertToErrorCode for Error values where no...
 
LLVM_ABI raw_fd_ostream & outs()
This returns a reference to a raw_fd_ostream for standard output.
 
static std::string remapPath(StringRef Path, const DWARFLinkerBase::ObjectPrefixMapTy &ObjectPrefixMap)
 
Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)
Create formatted StringError object.
 
static void resolveRelativeObjectPath(SmallVectorImpl< char > &Buf, DWARFDie CU)
Resolve the relative path to a build artifact referenced by DWARF by applying DW_AT_comp_dir.
 
static std::string getPCMFile(const DWARFDie &CUDie, const DWARFLinkerBase::ObjectPrefixMapTy *ObjectPrefixMap)
 
auto formatv(bool Validate, const char *Fmt, Ts &&...Vals)
 
void sort(IteratorTy Start, IteratorTy End)
 
ThreadPoolStrategy optimal_concurrency(unsigned TaskCount=0)
Returns an optimal thread strategy to execute specified amount of tasks.
 
static uint64_t getDwoId(const DWARFDie &CUDie)
 
Error make_error(ArgTs &&... Args)
Make a Error instance representing failure using the given error info type.
 
FunctionAddr VTableAddr uintptr_t uintptr_t Data
 
SingleThreadExecutor DefaultThreadPool
 
OutputIt move(R &&Range, OutputIt Out)
Provide wrappers to std::move which take ranges instead of having to pass begin/end explicitly.
 
bool is_contained(R &&Range, const E &Element)
Returns true if Element is found in Range.
 
void parallelForEach(IterTy Begin, IterTy End, FuncTy Fn)
 
void consumeError(Error Err)
Consume a Error without doing anything.
 
Implement std::hash so that hash_code can be used in STL containers.
 
Container for dump options that control which debug information will be dumped.
 
DIDumpOptions noImplicitRecursion() const
Return the options with RecurseDepth set to 0 unless explicitly required.
 
unsigned ChildRecurseDepth
 
DwarfStringPoolEntry with string keeping externally.
 
Keep information for referenced clang module: already loaded DWARF info of the clang module and a Com...
 
RefModuleUnit(DWARFFile &File, std::unique_ptr< CompileUnit > Unit)
 
std::unique_ptr< CompileUnit > Unit
 
uint64_t getInputDebugInfoSize() const
Computes the total size of the debug info.
 
bool InterCUProcessingStarted
Flag indicating that all inter-connected units are loaded and the dwarf linking process for these uni...
 
bool registerModuleReference(const DWARFDie &CUDie, ObjFileLoaderTy Loader, CompileUnitHandlerTy OnCUDieLoaded, unsigned Indent=0)
If this compile unit is really a skeleton CU that points to a clang module, register it in ClangModul...
 
Error loadClangModule(ObjFileLoaderTy Loader, const DWARFDie &CUDie, const std::string &PCMFile, CompileUnitHandlerTy OnCUDieLoaded, unsigned Indent=0)
Recursively add the debug info in this clang module .pcm file (and all the modules imported by it in ...
 
DWARFFile & InputDWARFFile
Object file descriptor.
 
LinkContext(LinkingGlobalData &GlobalData, DWARFFile &File, StringMap< uint64_t > &ClangModules, std::atomic< size_t > &UniqueUnitID)
 
uint64_t OriginalDebugInfoSize
Size of Debug info before optimizing.
 
Error emitInvariantSections()
Emit invariant sections.
 
std::pair< bool, bool > isClangModuleRef(const DWARFDie &CUDie, std::string &PCMFile, unsigned Indent, bool Quiet)
Check whether specified CUDie is a Clang module reference.
 
void addModulesCompileUnit(RefModuleUnit &&Unit)
Add Compile Unit corresponding to the module.
 
void emitFDE(uint32_t CIEOffset, uint32_t AddrSize, uint64_t Address, StringRef FDEBytes, SectionDescriptor &Section)
Emit FDE record.
 
UnitListTy CompileUnits
Set of Compilation Units(may be accessed asynchroniously for reading).
 
void linkSingleCompileUnit(CompileUnit &CU, TypeUnit *ArtificialTypeUnit, enum CompileUnit::Stage DoUntilStage=CompileUnit::Stage::Cleaned)
Link specified compile unit until specified stage.
 
std::atomic< bool > HasNewInterconnectedCUs
Flag indicating that new inter-connected compilation units were discovered.
 
StringMap< uint64_t > & ClangModules
 
Error cloneAndEmitDebugFrame()
Clone and emit .debug_frame.
 
std::atomic< size_t > & UniqueUnitID
Counter for compile units ID.
 
Error link(TypeUnit *ArtificialTypeUnit)
Link compile units for this context.
 
std::atomic< bool > HasNewGlobalDependency
 
std::function< CompileUnit *(uint64_t)> getUnitForOffset
 
ModuleUnitListTy ModulesCompileUnits
Set of Compile Units for modules.
 
This structure is used to update strings offsets into .debug_line_str.
 
This structure is used to update strings offsets into .debug_str.
 
const StringEntry * String
 
This structure keeps fields which would be used for creating accelerator table.
 
This structure is used to keep data of the concrete section.
 
raw_svector_ostream OS
Stream which stores data to the Contents.
 
void setSizesForSectionCreatedByAsmPrinter()
Some sections are emitted using AsmPrinter.