This is an archive of the discontinued LLVM Phabricator instance.

Reduce bit manipulation
DraftPublic

Authored by labath on Dec 19 2022, 5:53 AM.
This is a draft revision that has not yet been submitted for review.

Details

Reviewers
None

Diff Detail

Event Timeline

labath created this revision.Dec 19 2022, 5:53 AM
Herald added a project: Restricted Project. · View Herald TranscriptDec 19 2022, 5:53 AM
labath added inline comments.Dec 19 2022, 6:09 AM
lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARF.cpp
1403–1436

This code is fully and exclusively in charge of user_id encoding for the "DWO" case. We can replace 32 by DW_DIE_OFFSET_MAX_BITSIZE from your patch and 0x3fffffff by something like llvm::maskTrailingOnes(62-DW_DIE_OFFSET_MAX_BITSIZE). I believe that is sufficient to make it die-offset-width agnostic.

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDebugMap.cpp
771–789

This code is fully and exclusively in charge of DIERef->user_id_t conversion for the "oso" case. Replace 32 by DW_DIE_OFFSET_MAX_BITSIZE and dw_offset_t(XXX) by XXX & llvm::maskTrailingOnes<dw_offset_t>(DW_DIE_OFFSET_MAX_BITSIZE)

lldb/source/Plugins/SymbolFile/DWARF/SymbolFileDWARFDwo.h
43

This shift and the one below cancel each other out. Their presence is just a historic artefact.