Skip to content

Commit a58b20e

Browse files
committed
[llvm] Rename DwarfFile to DWARFFile to fix ODR violation (NFC)
Rename the DwarfFile class in DWARFLinker to DWARFFile. This is consistent with the other DWARF classes and avoids a ODR violation with the DwarfFile class in AsmPrinter.
1 parent e8beb69 commit a58b20e

File tree

4 files changed

+56
-56
lines changed

4 files changed

+56
-56
lines changed

llvm/include/llvm/DWARFLinker/DWARFLinker.h

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,9 @@ using UnitListTy = std::vector<std::unique_ptr<CompileUnit>>;
202202

203203
/// this class represents DWARF information for source file
204204
/// and it`s address map.
205-
class DwarfFile {
205+
class DWARFFile {
206206
public:
207-
DwarfFile(StringRef Name, DWARFContext *Dwarf, AddressesMap *Addresses,
207+
DWARFFile(StringRef Name, DWARFContext *Dwarf, AddressesMap *Addresses,
208208
const std::vector<std::string> &Warnings)
209209
: FileName(Name), Dwarf(Dwarf), Addresses(Addresses), Warnings(Warnings) {
210210
}
@@ -222,7 +222,7 @@ class DwarfFile {
222222
typedef std::function<void(const Twine &Warning, StringRef Context,
223223
const DWARFDie *DIE)>
224224
messageHandler;
225-
typedef std::function<ErrorOr<DwarfFile &>(StringRef ContainerName,
225+
typedef std::function<ErrorOr<DWARFFile &>(StringRef ContainerName,
226226
StringRef Path)>
227227
objFileLoader;
228228
typedef std::map<std::string, std::string> swiftInterfacesMap;
@@ -249,7 +249,7 @@ class DWARFLinker {
249249
: TheDwarfEmitter(Emitter), DwarfLinkerClientID(ClientID) {}
250250

251251
/// Add object file to be linked.
252-
void addObjectFile(DwarfFile &File);
252+
void addObjectFile(DWARFFile &File);
253253

254254
/// Link debug info for added objFiles. Object
255255
/// files are linked all together.
@@ -376,13 +376,13 @@ class DWARFLinker {
376376
/// returns true if we need to translate strings.
377377
bool needToTranslateStrings() { return StringsTranslator != nullptr; }
378378

379-
void reportWarning(const Twine &Warning, const DwarfFile &File,
379+
void reportWarning(const Twine &Warning, const DWARFFile &File,
380380
const DWARFDie *DIE = nullptr) const {
381381
if (Options.WarningHandler != nullptr)
382382
Options.WarningHandler(Warning, File.FileName, DIE);
383383
}
384384

385-
void reportError(const Twine &Warning, const DwarfFile &File,
385+
void reportError(const Twine &Warning, const DWARFFile &File,
386386
const DWARFDie *DIE = nullptr) const {
387387
if (Options.ErrorHandler != nullptr)
388388
Options.ErrorHandler(Warning, File.FileName, DIE);
@@ -398,18 +398,18 @@ class DWARFLinker {
398398
void updateAccelKind(DWARFContext &Dwarf);
399399

400400
/// Emit warnings as Dwarf compile units to leave a trail after linking.
401-
bool emitPaperTrailWarnings(const DwarfFile &File,
401+
bool emitPaperTrailWarnings(const DWARFFile &File,
402402
OffsetsStringPool &StringPool);
403403

404404
void copyInvariantDebugSection(DWARFContext &Dwarf);
405405

406406
/// Keeps track of data associated with one object during linking.
407407
struct LinkContext {
408-
DwarfFile &File;
408+
DWARFFile &File;
409409
UnitListTy CompileUnits;
410410
bool Skip = false;
411411

412-
LinkContext(DwarfFile &File) : File(File) {}
412+
LinkContext(DWARFFile &File) : File(File) {}
413413

414414
/// Clear part of the context that's no longer needed when we're done with
415415
/// the debug object.
@@ -438,7 +438,7 @@ class DWARFLinker {
438438
/// kept. All DIEs referenced though attributes should be kept.
439439
void lookForRefDIEsToKeep(const DWARFDie &Die, CompileUnit &CU,
440440
unsigned Flags, const UnitListTy &Units,
441-
const DwarfFile &File,
441+
const DWARFFile &File,
442442
SmallVectorImpl<WorklistItem> &Worklist);
443443

444444
/// \defgroup FindRootDIEs Find DIEs corresponding to Address map entries.
@@ -450,7 +450,7 @@ class DWARFLinker {
450450
/// The return value indicates whether the DIE is incomplete.
451451
void lookForDIEsToKeep(AddressesMap &RelocMgr, RangesTy &Ranges,
452452
const UnitListTy &Units, const DWARFDie &DIE,
453-
const DwarfFile &File, CompileUnit &CU,
453+
const DWARFFile &File, CompileUnit &CU,
454454
unsigned Flags);
455455

456456
/// If this compile unit is really a skeleton CU that points to a
@@ -460,7 +460,7 @@ class DWARFLinker {
460460
/// pointing to the module, and a DW_AT_gnu_dwo_id with the module
461461
/// hash.
462462
bool registerModuleReference(DWARFDie CUDie, const DWARFUnit &Unit,
463-
const DwarfFile &File,
463+
const DWARFFile &File,
464464
OffsetsStringPool &OffsetsStringPool,
465465
UniquingStringPool &UniquingStringPoolStringPool,
466466
DeclContextTree &ODRContexts,
@@ -473,7 +473,7 @@ class DWARFLinker {
473473
/// to Units.
474474
Error loadClangModule(DWARFDie CUDie, StringRef FilePath,
475475
StringRef ModuleName, uint64_t DwoId,
476-
const DwarfFile &File,
476+
const DWARFFile &File,
477477
OffsetsStringPool &OffsetsStringPool,
478478
UniquingStringPool &UniquingStringPool,
479479
DeclContextTree &ODRContexts, uint64_t ModulesEndOffset,
@@ -484,11 +484,11 @@ class DWARFLinker {
484484
void keepDIEAndDependencies(AddressesMap &RelocMgr, RangesTy &Ranges,
485485
const UnitListTy &Units, const DWARFDie &DIE,
486486
CompileUnit::DIEInfo &MyInfo,
487-
const DwarfFile &File, CompileUnit &CU,
487+
const DWARFFile &File, CompileUnit &CU,
488488
bool UseODR);
489489

490490
unsigned shouldKeepDIE(AddressesMap &RelocMgr, RangesTy &Ranges,
491-
const DWARFDie &DIE, const DwarfFile &File,
491+
const DWARFDie &DIE, const DWARFFile &File,
492492
CompileUnit &Unit, CompileUnit::DIEInfo &MyInfo,
493493
unsigned Flags);
494494

@@ -499,7 +499,7 @@ class DWARFLinker {
499499
CompileUnit::DIEInfo &MyInfo, unsigned Flags);
500500

501501
unsigned shouldKeepSubprogramDIE(AddressesMap &RelocMgr, RangesTy &Ranges,
502-
const DWARFDie &DIE, const DwarfFile &File,
502+
const DWARFDie &DIE, const DWARFFile &File,
503503
CompileUnit &Unit,
504504
CompileUnit::DIEInfo &MyInfo,
505505
unsigned Flags);
@@ -508,7 +508,7 @@ class DWARFLinker {
508508
/// RefValue. The resulting DIE might be in another CompileUnit which is
509509
/// stored into \p ReferencedCU. \returns null if resolving fails for any
510510
/// reason.
511-
DWARFDie resolveDIEReference(const DwarfFile &File, const UnitListTy &Units,
511+
DWARFDie resolveDIEReference(const DWARFFile &File, const UnitListTy &Units,
512512
const DWARFFormValue &RefValue,
513513
const DWARFDie &DIE, CompileUnit *&RefCU);
514514

@@ -523,7 +523,7 @@ class DWARFLinker {
523523
class DIECloner {
524524
DWARFLinker &Linker;
525525
DwarfEmitter *Emitter;
526-
DwarfFile &ObjFile;
526+
DWARFFile &ObjFile;
527527

528528
/// Allocator used for all the DIEValue objects.
529529
BumpPtrAllocator &DIEAlloc;
@@ -533,7 +533,7 @@ class DWARFLinker {
533533
bool Update;
534534

535535
public:
536-
DIECloner(DWARFLinker &Linker, DwarfEmitter *Emitter, DwarfFile &ObjFile,
536+
DIECloner(DWARFLinker &Linker, DwarfEmitter *Emitter, DWARFFile &ObjFile,
537537
BumpPtrAllocator &DIEAlloc,
538538
std::vector<std::unique_ptr<CompileUnit>> &CompileUnits,
539539
bool Update)
@@ -551,7 +551,7 @@ class DWARFLinker {
551551
/// applied to the entry point of the function to get the linked address.
552552
/// \param Die the output DIE to use, pass NULL to create one.
553553
/// \returns the root of the cloned tree or null if nothing was selected.
554-
DIE *cloneDIE(const DWARFDie &InputDIE, const DwarfFile &File,
554+
DIE *cloneDIE(const DWARFDie &InputDIE, const DWARFFile &File,
555555
CompileUnit &U, OffsetsStringPool &StringPool,
556556
int64_t PCOffset, uint32_t OutOffset, unsigned Flags,
557557
bool IsLittleEndian, DIE *Die = nullptr);
@@ -560,7 +560,7 @@ class DWARFLinker {
560560
/// chose to keep above. If there are no valid relocs, then there's
561561
/// nothing to clone/emit.
562562
uint64_t cloneAllCompileUnits(DWARFContext &DwarfContext,
563-
const DwarfFile &File,
563+
const DWARFFile &File,
564564
OffsetsStringPool &StringPool,
565565
bool IsLittleEndian);
566566

@@ -606,7 +606,7 @@ class DWARFLinker {
606606

607607
/// Helper for cloneDIE.
608608
unsigned cloneAttribute(DIE &Die, const DWARFDie &InputDIE,
609-
const DwarfFile &File, CompileUnit &U,
609+
const DWARFFile &File, CompileUnit &U,
610610
OffsetsStringPool &StringPool,
611611
const DWARFFormValue &Val,
612612
const AttributeSpec AttrSpec, unsigned AttrSize,
@@ -627,18 +627,18 @@ class DWARFLinker {
627627
AttributeSpec AttrSpec,
628628
unsigned AttrSize,
629629
const DWARFFormValue &Val,
630-
const DwarfFile &File,
630+
const DWARFFile &File,
631631
CompileUnit &Unit);
632632

633633
/// Clone a DWARF expression that may be referencing another DIE.
634634
void cloneExpression(DataExtractor &Data, DWARFExpression Expression,
635-
const DwarfFile &File, CompileUnit &Unit,
635+
const DWARFFile &File, CompileUnit &Unit,
636636
SmallVectorImpl<uint8_t> &OutputBuffer);
637637

638638
/// Clone an attribute referencing another DIE and add
639639
/// it to \p Die.
640640
/// \returns the size of the new attribute.
641-
unsigned cloneBlockAttribute(DIE &Die, const DwarfFile &File,
641+
unsigned cloneBlockAttribute(DIE &Die, const DWARFFile &File,
642642
CompileUnit &Unit, AttributeSpec AttrSpec,
643643
const DWARFFormValue &Val, unsigned AttrSize,
644644
bool IsLittleEndian);
@@ -654,7 +654,7 @@ class DWARFLinker {
654654
/// Clone a scalar attribute and add it to \p Die.
655655
/// \returns the size of the new attribute.
656656
unsigned cloneScalarAttribute(DIE &Die, const DWARFDie &InputDIE,
657-
const DwarfFile &File, CompileUnit &U,
657+
const DWARFFile &File, CompileUnit &U,
658658
AttributeSpec AttrSpec,
659659
const DWARFFormValue &Val, unsigned AttrSize,
660660
AttributesInfo &Info);
@@ -670,7 +670,7 @@ class DWARFLinker {
670670
void copyAbbrev(const DWARFAbbreviationDeclaration &Abbrev, bool hasODR);
671671

672672
uint32_t hashFullyQualifiedName(DWARFDie DIE, CompileUnit &U,
673-
const DwarfFile &File,
673+
const DWARFFile &File,
674674
int RecurseDepth = 0);
675675

676676
/// Helper for cloneDIE.
@@ -685,7 +685,7 @@ class DWARFLinker {
685685
/// Compute and emit debug_ranges section for \p Unit, and
686686
/// patch the attributes referencing it.
687687
void patchRangesForUnit(const CompileUnit &Unit, DWARFContext &Dwarf,
688-
const DwarfFile &File) const;
688+
const DWARFFile &File) const;
689689

690690
/// Generate and emit the DW_AT_ranges attribute for a compile_unit if it had
691691
/// one.
@@ -695,15 +695,15 @@ class DWARFLinker {
695695
/// parts according to the linked function ranges and emit the result in the
696696
/// debug_line section.
697697
void patchLineTableForUnit(CompileUnit &Unit, DWARFContext &OrigDwarf,
698-
const DwarfFile &File);
698+
const DWARFFile &File);
699699

700700
/// Emit the accelerator entries for \p Unit.
701701
void emitAcceleratorEntriesForUnit(CompileUnit &Unit);
702702
void emitDwarfAcceleratorEntriesForUnit(CompileUnit &Unit);
703703
void emitAppleAcceleratorEntriesForUnit(CompileUnit &Unit);
704704

705705
/// Patch the frame info for an object file and emit it.
706-
void patchFrameInfoForObject(const DwarfFile &, RangesTy &Ranges,
706+
void patchFrameInfoForObject(const DWARFFile &, RangesTy &Ranges,
707707
DWARFContext &, unsigned AddressSize);
708708

709709
/// FoldingSet that uniques the abbreviations.

0 commit comments

Comments
 (0)