Skip to content

Commit

Permalink
Merged main:44c05a627ffb into amd-gfx:3a0701ccd3fb
Browse files Browse the repository at this point in the history
Local branch amd-gfx 3a0701c Merged main:5e007afa9d4f into amd-gfx:4c17e1c71592
Remote branch main 44c05a6 [M68k] add 32 bit branch instrs and relaxations (llvm#117371)
  • Loading branch information
SC llvm team authored and SC llvm team committed Dec 12, 2024
2 parents 3a0701c + 44c05a6 commit 81347cb
Show file tree
Hide file tree
Showing 324 changed files with 8,825 additions and 3,270 deletions.
2 changes: 1 addition & 1 deletion bolt/include/bolt/Core/DIEBuilder.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class DIEBuilder {

/// Clone an attribute in reference format.
void cloneDieOffsetReferenceAttribute(
DIE &Die, const DWARFUnit &U, const DWARFDie &InputDIE,
DIE &Die, DWARFUnit &U, const DWARFDie &InputDIE,
const DWARFAbbreviationDeclaration::AttributeSpec AttrSpec, uint64_t Ref);

/// Clone an attribute in block format.
Expand Down
29 changes: 26 additions & 3 deletions bolt/include/bolt/Core/DebugNames.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ class DWARF5AcceleratorTable {
return std::move(FullTableBuffer);
}
/// Adds a DIE that is referenced across CUs.
void addCrossCUDie(const DIE *Die) {
CrossCUDies.insert({Die->getOffset(), Die});
void addCrossCUDie(DWARFUnit *Unit, const DIE *Die) {
CrossCUDies.insert({Die->getOffset(), {Unit, Die}});
}
/// Returns true if the DIE can generate an entry for a cross cu reference.
/// This only checks TAGs of a DIE because when this is invoked DIE might not
Expand Down Expand Up @@ -145,7 +145,7 @@ class DWARF5AcceleratorTable {
llvm::DenseMap<uint64_t, uint32_t> CUOffsetsToPatch;
// Contains a map of Entry ID to Entry relative offset.
llvm::DenseMap<uint64_t, uint32_t> EntryRelativeOffsets;
llvm::DenseMap<uint64_t, const DIE *> CrossCUDies;
llvm::DenseMap<uint64_t, std::pair<DWARFUnit *, const DIE *>> CrossCUDies;
/// Adds Unit to either CUList, LocalTUList or ForeignTUList.
/// Input Unit being processed, and DWO ID if Unit is being processed comes
/// from a DWO section.
Expand Down Expand Up @@ -191,6 +191,29 @@ class DWARF5AcceleratorTable {
void emitData();
/// Emit augmentation string.
void emitAugmentationString() const;
/// Creates a new entry for a given DIE.
std::optional<BOLTDWARF5AccelTableData *>
addEntry(DWARFUnit &DU, const DIE &CurrDie,
const std::optional<uint64_t> &DWOID,
const std::optional<BOLTDWARF5AccelTableData *> &Parent,
const std::optional<std::string> &Name,
const uint32_t NumberParentsInChain);
/// Returns UnitID for a given DWARFUnit.
uint32_t getUnitID(const DWARFUnit &Unit,
const std::optional<uint64_t> &DWOID, bool &IsTU);
std::optional<std::string> getName(DWARFUnit &DU,
const std::optional<uint64_t> &DWOID,
const std::string &NameToUse,
DIEValue ValName);
/// Processes a DIE with references to other DIEs for DW_AT_name and
/// DW_AT_linkage_name resolution.
/// If DW_AT_name exists method creates a new entry for this DIE and returns
/// it.
std::optional<BOLTDWARF5AccelTableData *> processReferencedDie(
DWARFUnit &Unit, const DIE &Die, const std::optional<uint64_t> &DWOID,
const std::optional<BOLTDWARF5AccelTableData *> &Parent,
const std::string &NameToUse, const uint32_t NumberParentsInChain,
const dwarf::Attribute &Attr);
};
} // namespace bolt
} // namespace llvm
Expand Down
4 changes: 2 additions & 2 deletions bolt/lib/Core/DIEBuilder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -622,7 +622,7 @@ DWARFDie DIEBuilder::resolveDIEReference(
}

void DIEBuilder::cloneDieOffsetReferenceAttribute(
DIE &Die, const DWARFUnit &U, const DWARFDie &InputDIE,
DIE &Die, DWARFUnit &U, const DWARFDie &InputDIE,
const DWARFAbbreviationDeclaration::AttributeSpec AttrSpec, uint64_t Ref) {
DIE *NewRefDie = nullptr;
DWARFUnit *RefUnit = nullptr;
Expand Down Expand Up @@ -654,7 +654,7 @@ void DIEBuilder::cloneDieOffsetReferenceAttribute(
// Adding referenced DIE to DebugNames to be used when entries are created
// that contain cross cu references.
if (DebugNamesTable.canGenerateEntryWithCrossCUReference(U, Die, AttrSpec))
DebugNamesTable.addCrossCUDie(DieInfo.Die);
DebugNamesTable.addCrossCUDie(&U, DieInfo.Die);
// no matter forward reference or backward reference, we are supposed
// to calculate them in `finish` due to the possible modification of
// the DIE.
Expand Down
Loading

0 comments on commit 81347cb

Please sign in to comment.