This is an archive of the discontinued LLVM Phabricator instance.

[DWARFLinkerParallel] add AddressesMap interface.
ClosedPublic

Authored by avl on Dec 30 2022, 12:33 PM.

Details

Summary

This patch is extracted from D96035. It adds AddressesMap map interface
to the DWARFLinkerParallel library. This interface mostly match with the
paired interface from the DWARFLinker library, except that it does
not depend on DIEInfo class.

Depends on D140787

Diff Detail

Event Timeline

avl created this revision.Dec 30 2022, 12:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 30 2022, 12:33 PM
avl requested review of this revision.Dec 30 2022, 12:33 PM
Herald added a project: Restricted Project. · View Herald TranscriptDec 30 2022, 12:33 PM
tschuett added inline comments.
llvm/include/llvm/DWARFLinkerNext/AddressesMap.h
17 ↗(On Diff #485724)

There is no next in the namespace? You can use nested namespaces.

38 ↗(On Diff #485724)

Is this the same as returning std::optional<int64_t>?

avl added inline comments.Dec 30 2022, 4:26 PM
llvm/include/llvm/DWARFLinkerNext/AddressesMap.h
17 ↗(On Diff #485724)

Current DWARFLinker does not use special namespace. Thus, name dwarflinker is free. I used it as it is shorter.

38 ↗(On Diff #485724)

isLiveVariable can change passed value. Not just return new value:

AddrAdjust -= uint64_t(*Reloc.Mapping->getValue().ObjectAddress);
avl added inline comments.Dec 30 2022, 4:35 PM
llvm/include/llvm/DWARFLinkerNext/AddressesMap.h
38 ↗(On Diff #485724)

please ignore above comment. yes, we can remove passing the value by reference. in this case it is probably better to rename the method:

std::optional<int64_t> getVariableAddress(const DWARFDie &DIE)

tschuett added inline comments.Dec 31 2022, 12:08 AM
llvm/include/llvm/DWARFLinkerNext/AddressesMap.h
43 ↗(On Diff #485724)

It is an odd pattern to pass integers by reference for mutability.

avl updated this revision to Diff 485755.Dec 31 2022, 2:04 AM

changed signature for isLiveVariable and isLiveSubprogram.

avl updated this revision to Diff 494639.Feb 3 2023, 7:45 AM

rebased.

avl retitled this revision from [DWARFLinkerNext] add AddressesMap interface. to [DWARFLinkerParallel] add AddressesMap interface..Feb 3 2023, 7:46 AM
avl edited the summary of this revision. (Show Details)
avl added a comment.Feb 27 2023, 11:44 AM

friendly ping.

avl added a comment.Mar 7 2023, 12:38 AM

friendly ping.

avl added a comment.Mar 14 2023, 3:08 AM

friendly ping.

JDevlieghere accepted this revision.Mar 14 2023, 9:33 PM

LGMT with some wordsmithing

llvm/include/llvm/DWARFLinkerParallel/AddressesMap.h
32–33
36–41
45–50
61–62
This revision is now accepted and ready to land.Mar 14 2023, 9:33 PM
avl added a comment.Mar 15 2023, 10:16 AM

Thank you for the review!

This revision was automatically updated to reflect the committed changes.