File indexing completed on 2026-05-10 08:43:48
0001
0002
0003
0004
0005
0006
0007
0008
0009 #ifndef LLVM_DWARFLINKER_CLASSIC_DWARFLINKER_H
0010 #define LLVM_DWARFLINKER_CLASSIC_DWARFLINKER_H
0011
0012 #include "llvm/ADT/AddressRanges.h"
0013 #include "llvm/ADT/DenseMap.h"
0014 #include "llvm/CodeGen/AccelTable.h"
0015 #include "llvm/CodeGen/NonRelocatableStringpool.h"
0016 #include "llvm/DWARFLinker/Classic/DWARFLinkerCompileUnit.h"
0017 #include "llvm/DWARFLinker/DWARFLinkerBase.h"
0018 #include "llvm/DWARFLinker/IndexedValuesMap.h"
0019 #include "llvm/DebugInfo/DWARF/DWARFContext.h"
0020 #include "llvm/DebugInfo/DWARF/DWARFDebugLine.h"
0021 #include "llvm/DebugInfo/DWARF/DWARFDebugRangeList.h"
0022 #include "llvm/DebugInfo/DWARF/DWARFDie.h"
0023 #include "llvm/DebugInfo/DWARF/DWARFExpression.h"
0024 #include <map>
0025
0026 namespace llvm {
0027 class DWARFExpression;
0028 class DWARFUnit;
0029 class DataExtractor;
0030 template <typename T> class SmallVectorImpl;
0031
0032 namespace dwarf_linker {
0033 namespace classic {
0034 class DeclContextTree;
0035
0036 using Offset2UnitMap = DenseMap<uint64_t, CompileUnit *>;
0037 using DebugDieValuePool = IndexedValuesMap<uint64_t>;
0038
0039
0040 class DwarfEmitter {
0041 public:
0042 virtual ~DwarfEmitter() = default;
0043
0044
0045 virtual void emitSectionContents(StringRef SecData,
0046 DebugSectionKind SecKind) = 0;
0047
0048
0049 virtual void
0050 emitAbbrevs(const std::vector<std::unique_ptr<DIEAbbrev>> &Abbrevs,
0051 unsigned DwarfVersion) = 0;
0052
0053
0054 virtual void emitStrings(const NonRelocatableStringpool &Pool) = 0;
0055
0056
0057
0058 virtual void emitStringOffsets(const SmallVector<uint64_t> &StringOffsets,
0059 uint16_t TargetDWARFVersion) = 0;
0060
0061
0062 virtual void emitLineStrings(const NonRelocatableStringpool &Pool) = 0;
0063
0064
0065 virtual void emitDebugNames(DWARF5AccelTable &Table) = 0;
0066
0067
0068 virtual void
0069 emitAppleNamespaces(AccelTable<AppleAccelTableStaticOffsetData> &Table) = 0;
0070
0071
0072 virtual void
0073 emitAppleNames(AccelTable<AppleAccelTableStaticOffsetData> &Table) = 0;
0074
0075
0076 virtual void
0077 emitAppleObjc(AccelTable<AppleAccelTableStaticOffsetData> &Table) = 0;
0078
0079
0080 virtual void
0081 emitAppleTypes(AccelTable<AppleAccelTableStaticTypeData> &Table) = 0;
0082
0083
0084 virtual MCSymbol *emitDwarfDebugRangeListHeader(const CompileUnit &Unit) = 0;
0085
0086
0087 virtual void emitDwarfDebugRangeListFragment(
0088 const CompileUnit &Unit, const AddressRanges &LinkedRanges,
0089 PatchLocation Patch, DebugDieValuePool &AddrPool) = 0;
0090
0091
0092 virtual void emitDwarfDebugRangeListFooter(const CompileUnit &Unit,
0093 MCSymbol *EndLabel) = 0;
0094
0095
0096 virtual MCSymbol *emitDwarfDebugLocListHeader(const CompileUnit &Unit) = 0;
0097
0098
0099 virtual void emitDwarfDebugLocListFragment(
0100 const CompileUnit &Unit,
0101 const DWARFLocationExpressionsVector &LinkedLocationExpression,
0102 PatchLocation Patch, DebugDieValuePool &AddrPool) = 0;
0103
0104
0105 virtual void emitDwarfDebugLocListFooter(const CompileUnit &Unit,
0106 MCSymbol *EndLabel) = 0;
0107
0108
0109 virtual MCSymbol *emitDwarfDebugAddrsHeader(const CompileUnit &Unit) = 0;
0110
0111
0112 virtual void emitDwarfDebugAddrs(const SmallVector<uint64_t> &Addrs,
0113 uint8_t AddrSize) = 0;
0114
0115
0116 virtual void emitDwarfDebugAddrsFooter(const CompileUnit &Unit,
0117 MCSymbol *EndLabel) = 0;
0118
0119
0120 virtual void
0121 emitDwarfDebugArangesTable(const CompileUnit &Unit,
0122 const AddressRanges &LinkedRanges) = 0;
0123
0124
0125 virtual void emitLineTableForUnit(const DWARFDebugLine::LineTable &LineTable,
0126 const CompileUnit &Unit,
0127 OffsetsStringPool &DebugStrPool,
0128 OffsetsStringPool &DebugLineStrPool) = 0;
0129
0130
0131 virtual void emitPubNamesForUnit(const CompileUnit &Unit) = 0;
0132
0133
0134 virtual void emitPubTypesForUnit(const CompileUnit &Unit) = 0;
0135
0136
0137 virtual void emitCIE(StringRef CIEBytes) = 0;
0138
0139
0140 virtual void emitFDE(uint32_t CIEOffset, uint32_t AddreSize, uint64_t Address,
0141 StringRef Bytes) = 0;
0142
0143
0144
0145
0146
0147
0148 virtual void emitCompileUnitHeader(CompileUnit &Unit,
0149 unsigned DwarfVersion) = 0;
0150
0151
0152 virtual void emitDIE(DIE &Die) = 0;
0153
0154
0155
0156
0157
0158
0159 virtual void emitMacroTables(DWARFContext *Context,
0160 const Offset2UnitMap &UnitMacroMap,
0161 OffsetsStringPool &StringPool) = 0;
0162
0163
0164 virtual uint64_t getLineSectionSize() const = 0;
0165
0166
0167 virtual uint64_t getFrameSectionSize() const = 0;
0168
0169
0170 virtual uint64_t getRangesSectionSize() const = 0;
0171
0172
0173 virtual uint64_t getRngListsSectionSize() const = 0;
0174
0175
0176 virtual uint64_t getDebugInfoSectionSize() const = 0;
0177
0178
0179 virtual uint64_t getDebugMacInfoSectionSize() const = 0;
0180
0181
0182 virtual uint64_t getDebugMacroSectionSize() const = 0;
0183
0184
0185 virtual uint64_t getLocListsSectionSize() const = 0;
0186
0187
0188 virtual uint64_t getDebugAddrSectionSize() const = 0;
0189
0190
0191 virtual void finish() = 0;
0192 };
0193
0194 class DwarfStreamer;
0195 using UnitListTy = std::vector<std::unique_ptr<CompileUnit>>;
0196
0197
0198
0199
0200
0201
0202
0203
0204
0205
0206
0207
0208
0209
0210
0211 class DWARFLinker : public DWARFLinkerBase {
0212 public:
0213 DWARFLinker(MessageHandlerTy ErrorHandler, MessageHandlerTy WarningHandler,
0214 std::function<StringRef(StringRef)> StringsTranslator)
0215 : StringsTranslator(StringsTranslator), ErrorHandler(ErrorHandler),
0216 WarningHandler(WarningHandler) {}
0217
0218 static std::unique_ptr<DWARFLinker> createLinker(
0219 MessageHandlerTy ErrorHandler, MessageHandlerTy WarningHandler,
0220 std::function<StringRef(StringRef)> StringsTranslator = nullptr) {
0221 return std::make_unique<DWARFLinker>(ErrorHandler, WarningHandler,
0222 StringsTranslator);
0223 }
0224
0225
0226 void setOutputDWARFEmitter(DwarfEmitter *Emitter) {
0227 TheDwarfEmitter = Emitter;
0228 }
0229
0230
0231
0232
0233
0234
0235
0236 void addObjectFile(
0237 DWARFFile &File, ObjFileLoaderTy Loader = nullptr,
0238 CompileUnitHandlerTy OnCUDieLoaded = [](const DWARFUnit &) {}) override;
0239
0240
0241 Error link() override;
0242
0243
0244
0245
0246 void setVerbosity(bool Verbose) override { Options.Verbose = Verbose; }
0247
0248
0249 void setStatistics(bool Statistics) override {
0250 Options.Statistics = Statistics;
0251 }
0252
0253
0254 void setVerifyInputDWARF(bool Verify) override {
0255 Options.VerifyInputDWARF = Verify;
0256 }
0257
0258
0259 void setNoODR(bool NoODR) override { Options.NoODR = NoODR; }
0260
0261
0262 void setUpdateIndexTablesOnly(bool Update) override {
0263 Options.Update = Update;
0264 }
0265
0266
0267 void setAllowNonDeterministicOutput(bool) override {
0268 }
0269
0270
0271 void setKeepFunctionForStatic(bool KeepFunctionForStatic) override {
0272 Options.KeepFunctionForStatic = KeepFunctionForStatic;
0273 }
0274
0275
0276 void setNumThreads(unsigned NumThreads) override {
0277 Options.Threads = NumThreads;
0278 }
0279
0280
0281 void addAccelTableKind(AccelTableKind Kind) override {
0282 assert(!llvm::is_contained(Options.AccelTables, Kind));
0283 Options.AccelTables.emplace_back(Kind);
0284 }
0285
0286
0287 void setPrependPath(StringRef Ppath) override { Options.PrependPath = Ppath; }
0288
0289
0290 void setEstimatedObjfilesAmount(unsigned ObjFilesNum) override {
0291 ObjectContexts.reserve(ObjFilesNum);
0292 }
0293
0294
0295
0296 void
0297 setInputVerificationHandler(InputVerificationHandlerTy Handler) override {
0298 Options.InputVerificationHandler = Handler;
0299 }
0300
0301
0302 void setSwiftInterfacesMap(SwiftInterfacesMapTy *Map) override {
0303 Options.ParseableSwiftInterfaces = Map;
0304 }
0305
0306
0307 void setObjectPrefixMap(ObjectPrefixMapTy *Map) override {
0308 Options.ObjectPrefixMap = Map;
0309 }
0310
0311
0312 Error setTargetDWARFVersion(uint16_t TargetDWARFVersion) override {
0313 if ((TargetDWARFVersion < 1) || (TargetDWARFVersion > 5))
0314 return createStringError(std::errc::invalid_argument,
0315 "unsupported DWARF version: %d",
0316 TargetDWARFVersion);
0317
0318 Options.TargetDWARFVersion = TargetDWARFVersion;
0319 return Error::success();
0320 }
0321
0322 private:
0323
0324 enum TraversalFlags {
0325 TF_Keep = 1 << 0,
0326 TF_InFunctionScope = 1 << 1,
0327 TF_DependencyWalk = 1 << 2,
0328 TF_ParentWalk = 1 << 3,
0329 TF_ODR = 1 << 4,
0330 TF_SkipPC = 1 << 5,
0331 };
0332
0333
0334 enum class WorklistItemType {
0335
0336 LookForDIEsToKeep,
0337
0338 LookForChildDIEsToKeep,
0339
0340 LookForRefDIEsToKeep,
0341
0342 LookForParentDIEsToKeep,
0343
0344
0345 UpdateChildIncompleteness,
0346
0347
0348 UpdateRefIncompleteness,
0349
0350 MarkODRCanonicalDie,
0351 };
0352
0353
0354
0355
0356 struct WorklistItem {
0357 DWARFDie Die;
0358 WorklistItemType Type;
0359 CompileUnit &CU;
0360 unsigned Flags;
0361 union {
0362 const unsigned AncestorIdx;
0363 CompileUnit::DIEInfo *OtherInfo;
0364 };
0365
0366 WorklistItem(DWARFDie Die, CompileUnit &CU, unsigned Flags,
0367 WorklistItemType T = WorklistItemType::LookForDIEsToKeep)
0368 : Die(Die), Type(T), CU(CU), Flags(Flags), AncestorIdx(0) {}
0369
0370 WorklistItem(DWARFDie Die, CompileUnit &CU, WorklistItemType T,
0371 CompileUnit::DIEInfo *OtherInfo = nullptr)
0372 : Die(Die), Type(T), CU(CU), Flags(0), OtherInfo(OtherInfo) {}
0373
0374 WorklistItem(unsigned AncestorIdx, CompileUnit &CU, unsigned Flags)
0375 : Type(WorklistItemType::LookForParentDIEsToKeep), CU(CU), Flags(Flags),
0376 AncestorIdx(AncestorIdx) {}
0377 };
0378
0379
0380 void verifyInput(const DWARFFile &File);
0381
0382
0383 bool needToTranslateStrings() { return StringsTranslator != nullptr; }
0384
0385 void reportWarning(const Twine &Warning, const DWARFFile &File,
0386 const DWARFDie *DIE = nullptr) const {
0387 if (WarningHandler != nullptr)
0388 WarningHandler(Warning, File.FileName, DIE);
0389 }
0390
0391 void reportError(const Twine &Warning, const DWARFFile &File,
0392 const DWARFDie *DIE = nullptr) const {
0393 if (ErrorHandler != nullptr)
0394 ErrorHandler(Warning, File.FileName, DIE);
0395 }
0396
0397 void copyInvariantDebugSection(DWARFContext &Dwarf);
0398
0399
0400
0401 struct RefModuleUnit {
0402 RefModuleUnit(DWARFFile &File, std::unique_ptr<CompileUnit> Unit)
0403 : File(File), Unit(std::move(Unit)) {}
0404 RefModuleUnit(RefModuleUnit &&Other)
0405 : File(Other.File), Unit(std::move(Other.Unit)) {}
0406 RefModuleUnit(const RefModuleUnit &) = delete;
0407
0408 DWARFFile &File;
0409 std::unique_ptr<CompileUnit> Unit;
0410 };
0411 using ModuleUnitListTy = std::vector<RefModuleUnit>;
0412
0413
0414 struct LinkContext {
0415 DWARFFile &File;
0416 UnitListTy CompileUnits;
0417 ModuleUnitListTy ModuleUnits;
0418 bool Skip = false;
0419
0420 LinkContext(DWARFFile &File) : File(File) {}
0421
0422
0423
0424 void clear() {
0425 CompileUnits.clear();
0426 ModuleUnits.clear();
0427 File.unload();
0428 }
0429 };
0430
0431
0432 void cleanupAuxiliarryData(LinkContext &Context);
0433
0434
0435
0436 void lookForParentDIEsToKeep(unsigned AncestorIdx, CompileUnit &CU,
0437 unsigned Flags,
0438 SmallVectorImpl<WorklistItem> &Worklist);
0439
0440
0441
0442 void lookForChildDIEsToKeep(const DWARFDie &Die, CompileUnit &CU,
0443 unsigned Flags,
0444 SmallVectorImpl<WorklistItem> &Worklist);
0445
0446
0447
0448 void lookForRefDIEsToKeep(const DWARFDie &Die, CompileUnit &CU,
0449 unsigned Flags, const UnitListTy &Units,
0450 const DWARFFile &File,
0451 SmallVectorImpl<WorklistItem> &Worklist);
0452
0453
0454
0455 void markODRCanonicalDie(const DWARFDie &Die, CompileUnit &CU);
0456
0457
0458
0459
0460
0461
0462
0463
0464 void lookForDIEsToKeep(AddressesMap &RelocMgr, const UnitListTy &Units,
0465 const DWARFDie &DIE, const DWARFFile &File,
0466 CompileUnit &CU, unsigned Flags);
0467
0468
0469
0470
0471
0472 std::pair<bool, bool> isClangModuleRef(const DWARFDie &CUDie,
0473 std::string &PCMFile,
0474 LinkContext &Context, unsigned Indent,
0475 bool Quiet);
0476
0477
0478
0479
0480
0481
0482
0483 bool registerModuleReference(const DWARFDie &CUDie, LinkContext &Context,
0484 ObjFileLoaderTy Loader,
0485 CompileUnitHandlerTy OnCUDieLoaded,
0486 unsigned Indent = 0);
0487
0488
0489
0490
0491 Error loadClangModule(ObjFileLoaderTy Loader, const DWARFDie &CUDie,
0492 const std::string &PCMFile, LinkContext &Context,
0493 CompileUnitHandlerTy OnCUDieLoaded,
0494 unsigned Indent = 0);
0495
0496
0497 Error cloneModuleUnit(LinkContext &Context, RefModuleUnit &Unit,
0498 DeclContextTree &ODRContexts,
0499 OffsetsStringPool &DebugStrPool,
0500 OffsetsStringPool &DebugLineStrPool,
0501 DebugDieValuePool &StringOffsetPool,
0502 unsigned Indent = 0);
0503
0504 unsigned shouldKeepDIE(AddressesMap &RelocMgr, const DWARFDie &DIE,
0505 const DWARFFile &File, CompileUnit &Unit,
0506 CompileUnit::DIEInfo &MyInfo, unsigned Flags);
0507
0508
0509
0510
0511
0512
0513
0514 std::pair<bool, std::optional<int64_t>>
0515 getVariableRelocAdjustment(AddressesMap &RelocMgr, const DWARFDie &DIE);
0516
0517
0518
0519 unsigned shouldKeepVariableDIE(AddressesMap &RelocMgr, const DWARFDie &DIE,
0520 CompileUnit::DIEInfo &MyInfo, unsigned Flags);
0521
0522 unsigned shouldKeepSubprogramDIE(AddressesMap &RelocMgr, const DWARFDie &DIE,
0523 const DWARFFile &File, CompileUnit &Unit,
0524 CompileUnit::DIEInfo &MyInfo,
0525 unsigned Flags);
0526
0527
0528
0529
0530
0531 DWARFDie resolveDIEReference(const DWARFFile &File, const UnitListTy &Units,
0532 const DWARFFormValue &RefValue,
0533 const DWARFDie &DIE, CompileUnit *&RefCU);
0534
0535
0536
0537
0538
0539
0540
0541 struct DWARFLinkerOptions;
0542
0543 class DIECloner {
0544 DWARFLinker &Linker;
0545 DwarfEmitter *Emitter;
0546 DWARFFile &ObjFile;
0547 OffsetsStringPool &DebugStrPool;
0548 OffsetsStringPool &DebugLineStrPool;
0549 DebugDieValuePool &StringOffsetPool;
0550 DebugDieValuePool AddrPool;
0551
0552
0553 BumpPtrAllocator &DIEAlloc;
0554
0555 std::vector<std::unique_ptr<CompileUnit>> &CompileUnits;
0556
0557
0558
0559 Offset2UnitMap UnitMacroMap;
0560
0561 bool Update;
0562
0563 public:
0564 DIECloner(DWARFLinker &Linker, DwarfEmitter *Emitter, DWARFFile &ObjFile,
0565 BumpPtrAllocator &DIEAlloc,
0566 std::vector<std::unique_ptr<CompileUnit>> &CompileUnits,
0567 bool Update, OffsetsStringPool &DebugStrPool,
0568 OffsetsStringPool &DebugLineStrPool,
0569 DebugDieValuePool &StringOffsetPool)
0570 : Linker(Linker), Emitter(Emitter), ObjFile(ObjFile),
0571 DebugStrPool(DebugStrPool), DebugLineStrPool(DebugLineStrPool),
0572 StringOffsetPool(StringOffsetPool), DIEAlloc(DIEAlloc),
0573 CompileUnits(CompileUnits), Update(Update) {}
0574
0575
0576
0577
0578
0579
0580
0581
0582
0583
0584
0585
0586 DIE *cloneDIE(const DWARFDie &InputDIE, const DWARFFile &File,
0587 CompileUnit &U, int64_t PCOffset, uint32_t OutOffset,
0588 unsigned Flags, bool IsLittleEndian, DIE *Die = nullptr);
0589
0590
0591
0592
0593 uint64_t cloneAllCompileUnits(DWARFContext &DwarfContext,
0594 const DWARFFile &File, bool IsLittleEndian);
0595
0596
0597 void emitDebugAddrSection(CompileUnit &Unit,
0598 const uint16_t DwarfVersion) const;
0599
0600 using ExpressionHandlerRef = function_ref<void(
0601 SmallVectorImpl<uint8_t> &, SmallVectorImpl<uint8_t> &,
0602 int64_t AddrRelocAdjustment)>;
0603
0604
0605
0606 void generateUnitLocations(CompileUnit &Unit, const DWARFFile &File,
0607 ExpressionHandlerRef ExprHandler);
0608
0609 private:
0610 using AttributeSpec = DWARFAbbreviationDeclaration::AttributeSpec;
0611
0612
0613
0614 struct AttributesInfo {
0615
0616 DwarfStringPoolEntryRef Name, MangledName, NameWithoutTemplate;
0617
0618
0619 uint32_t NameOffset = 0;
0620 uint32_t MangledNameOffset = 0;
0621
0622
0623 int64_t PCOffset = 0;
0624
0625
0626 bool HasLowPc = false;
0627
0628
0629 bool HasRanges = false;
0630
0631
0632 bool IsDeclaration = false;
0633
0634
0635 bool AttrStrOffsetBaseSeen = false;
0636
0637
0638 bool HasAppleOrigin = false;
0639
0640 AttributesInfo() = default;
0641 };
0642
0643
0644 unsigned cloneAttribute(DIE &Die, const DWARFDie &InputDIE,
0645 const DWARFFile &File, CompileUnit &U,
0646 const DWARFFormValue &Val,
0647 const AttributeSpec AttrSpec, unsigned AttrSize,
0648 AttributesInfo &AttrInfo, bool IsLittleEndian);
0649
0650
0651
0652
0653 unsigned cloneStringAttribute(DIE &Die, AttributeSpec AttrSpec,
0654 const DWARFFormValue &Val, const DWARFUnit &U,
0655 AttributesInfo &Info);
0656
0657
0658
0659
0660 unsigned cloneDieReferenceAttribute(DIE &Die, const DWARFDie &InputDIE,
0661 AttributeSpec AttrSpec,
0662 unsigned AttrSize,
0663 const DWARFFormValue &Val,
0664 const DWARFFile &File,
0665 CompileUnit &Unit);
0666
0667
0668 void cloneExpression(DataExtractor &Data, DWARFExpression Expression,
0669 const DWARFFile &File, CompileUnit &Unit,
0670 SmallVectorImpl<uint8_t> &OutputBuffer,
0671 int64_t AddrRelocAdjustment, bool IsLittleEndian);
0672
0673
0674
0675
0676 unsigned cloneBlockAttribute(DIE &Die, const DWARFDie &InputDIE,
0677 const DWARFFile &File, CompileUnit &Unit,
0678 AttributeSpec AttrSpec,
0679 const DWARFFormValue &Val,
0680 bool IsLittleEndian);
0681
0682
0683
0684
0685 unsigned cloneAddressAttribute(DIE &Die, const DWARFDie &InputDIE,
0686 AttributeSpec AttrSpec, unsigned AttrSize,
0687 const DWARFFormValue &Val,
0688 const CompileUnit &Unit,
0689 AttributesInfo &Info);
0690
0691
0692
0693 unsigned cloneScalarAttribute(DIE &Die, const DWARFDie &InputDIE,
0694 const DWARFFile &File, CompileUnit &U,
0695 AttributeSpec AttrSpec,
0696 const DWARFFormValue &Val, unsigned AttrSize,
0697 AttributesInfo &Info);
0698
0699
0700
0701
0702
0703 bool getDIENames(const DWARFDie &Die, AttributesInfo &Info,
0704 OffsetsStringPool &StringPool, bool StripTemplate = false);
0705
0706 uint32_t hashFullyQualifiedName(DWARFDie DIE, CompileUnit &U,
0707 const DWARFFile &File,
0708 int RecurseDepth = 0);
0709
0710
0711 void addObjCAccelerator(CompileUnit &Unit, const DIE *Die,
0712 DwarfStringPoolEntryRef Name,
0713 OffsetsStringPool &StringPool, bool SkipPubSection);
0714
0715 void rememberUnitForMacroOffset(CompileUnit &Unit);
0716
0717
0718
0719
0720 void generateLineTableForUnit(CompileUnit &Unit);
0721 };
0722
0723
0724 void assignAbbrev(DIEAbbrev &Abbrev);
0725
0726
0727
0728 void generateUnitRanges(CompileUnit &Unit, const DWARFFile &File,
0729 DebugDieValuePool &AddrPool) const;
0730
0731
0732 void emitAcceleratorEntriesForUnit(CompileUnit &Unit);
0733
0734
0735 void patchFrameInfoForObject(LinkContext &Context);
0736
0737
0738 FoldingSet<DIEAbbrev> AbbreviationsSet;
0739
0740
0741
0742
0743 std::vector<std::unique_ptr<DIEAbbrev>> Abbreviations;
0744
0745
0746 std::vector<DIELoc *> DIELocs;
0747
0748
0749 std::vector<DIEBlock *> DIEBlocks;
0750
0751
0752 BumpPtrAllocator DIEAlloc;
0753
0754
0755 DwarfEmitter *TheDwarfEmitter = nullptr;
0756 std::vector<LinkContext> ObjectContexts;
0757
0758
0759
0760
0761 StringMap<uint32_t> EmittedCIEs;
0762
0763
0764
0765 uint32_t LastCIEOffset = 0;
0766
0767
0768 DWARF5AccelTable DebugNames;
0769 AccelTable<AppleAccelTableStaticOffsetData> AppleNames;
0770 AccelTable<AppleAccelTableStaticOffsetData> AppleNamespaces;
0771 AccelTable<AppleAccelTableStaticOffsetData> AppleObjc;
0772 AccelTable<AppleAccelTableStaticTypeData> AppleTypes;
0773
0774
0775 StringMap<uint64_t> ClangModules;
0776
0777 std::function<StringRef(StringRef)> StringsTranslator = nullptr;
0778
0779
0780 unsigned UniqueUnitID = 0;
0781
0782
0783 MessageHandlerTy ErrorHandler = nullptr;
0784
0785
0786 MessageHandlerTy WarningHandler = nullptr;
0787
0788
0789 struct DWARFLinkerOptions {
0790
0791 uint16_t TargetDWARFVersion = 0;
0792
0793
0794 bool Verbose = false;
0795
0796
0797 bool Statistics = false;
0798
0799
0800 bool VerifyInputDWARF = false;
0801
0802
0803 bool NoODR = false;
0804
0805
0806 bool Update = false;
0807
0808
0809
0810 bool KeepFunctionForStatic = false;
0811
0812
0813 unsigned Threads = 1;
0814
0815
0816 SmallVector<AccelTableKind, 1> AccelTables;
0817
0818
0819 std::string PrependPath;
0820
0821
0822 InputVerificationHandlerTy InputVerificationHandler = nullptr;
0823
0824
0825
0826
0827
0828
0829 SwiftInterfacesMapTy *ParseableSwiftInterfaces = nullptr;
0830
0831
0832 ObjectPrefixMapTy *ObjectPrefixMap = nullptr;
0833 } Options;
0834 };
0835
0836 }
0837 }
0838 }
0839
0840 #endif