Skip to content

Commit f53cf1b

Browse files
committed
Merge remote-tracking branch 'origin/main' into vplan-runtime-checks
2 parents 4a51d29 + 08c9bb2 commit f53cf1b

File tree

317 files changed

+12945
-4601
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

317 files changed

+12945
-4601
lines changed

bolt/include/bolt/Core/DIEBuilder.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ class DIEBuilder {
162162

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

168168
/// Clone an attribute in block format.

bolt/include/bolt/Core/DebugNames.h

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ class DWARF5AcceleratorTable {
7272
return std::move(FullTableBuffer);
7373
}
7474
/// Adds a DIE that is referenced across CUs.
75-
void addCrossCUDie(const DIE *Die) {
76-
CrossCUDies.insert({Die->getOffset(), Die});
75+
void addCrossCUDie(DWARFUnit *Unit, const DIE *Die) {
76+
CrossCUDies.insert({Die->getOffset(), {Unit, Die}});
7777
}
7878
/// Returns true if the DIE can generate an entry for a cross cu reference.
7979
/// This only checks TAGs of a DIE because when this is invoked DIE might not
@@ -145,7 +145,7 @@ class DWARF5AcceleratorTable {
145145
llvm::DenseMap<uint64_t, uint32_t> CUOffsetsToPatch;
146146
// Contains a map of Entry ID to Entry relative offset.
147147
llvm::DenseMap<uint64_t, uint32_t> EntryRelativeOffsets;
148-
llvm::DenseMap<uint64_t, const DIE *> CrossCUDies;
148+
llvm::DenseMap<uint64_t, std::pair<DWARFUnit *, const DIE *>> CrossCUDies;
149149
/// Adds Unit to either CUList, LocalTUList or ForeignTUList.
150150
/// Input Unit being processed, and DWO ID if Unit is being processed comes
151151
/// from a DWO section.
@@ -191,6 +191,29 @@ class DWARF5AcceleratorTable {
191191
void emitData();
192192
/// Emit augmentation string.
193193
void emitAugmentationString() const;
194+
/// Creates a new entry for a given DIE.
195+
std::optional<BOLTDWARF5AccelTableData *>
196+
addEntry(DWARFUnit &DU, const DIE &CurrDie,
197+
const std::optional<uint64_t> &DWOID,
198+
const std::optional<BOLTDWARF5AccelTableData *> &Parent,
199+
const std::optional<std::string> &Name,
200+
const uint32_t NumberParentsInChain);
201+
/// Returns UnitID for a given DWARFUnit.
202+
uint32_t getUnitID(const DWARFUnit &Unit,
203+
const std::optional<uint64_t> &DWOID, bool &IsTU);
204+
std::optional<std::string> getName(DWARFUnit &DU,
205+
const std::optional<uint64_t> &DWOID,
206+
const std::string &NameToUse,
207+
DIEValue ValName);
208+
/// Processes a DIE with references to other DIEs for DW_AT_name and
209+
/// DW_AT_linkage_name resolution.
210+
/// If DW_AT_name exists method creates a new entry for this DIE and returns
211+
/// it.
212+
std::optional<BOLTDWARF5AccelTableData *> processReferencedDie(
213+
DWARFUnit &Unit, const DIE &Die, const std::optional<uint64_t> &DWOID,
214+
const std::optional<BOLTDWARF5AccelTableData *> &Parent,
215+
const std::string &NameToUse, const uint32_t NumberParentsInChain,
216+
const dwarf::Attribute &Attr);
194217
};
195218
} // namespace bolt
196219
} // namespace llvm

bolt/lib/Core/DIEBuilder.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -622,7 +622,7 @@ DWARFDie DIEBuilder::resolveDIEReference(
622622
}
623623

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

0 commit comments

Comments
 (0)