This is an archive of the discontinued LLVM Phabricator instance.

[Object] Refactor build ID parsing into Object lib.
ClosedPublic

Authored by mysterymath on Apr 3 2023, 4:39 PM.

Details

Summary

This makes parsing for build IDs in the markup filter slightly more
permissive, in line with fromHex.

It also removes the distinction between missing build ID and empty build
ID; empty build IDs aren't a useful concept, since their purpose is to
uniquely identify a binary. This removes a layer of indirection wherever
build IDs are obtained.

Diff Detail

Event Timeline

mysterymath created this revision.Apr 3 2023, 4:39 PM
Herald added a reviewer: MaskRay. · View Herald Transcript
Herald added a project: Restricted Project. · View Herald Transcript
Herald added a subscriber: hiraditya. · View Herald Transcript
mysterymath published this revision for review.Apr 3 2023, 4:41 PM
mysterymath added a reviewer: gulfem.
Herald added a project: Restricted Project. · View Herald TranscriptApr 3 2023, 4:41 PM

Rebase off of change stack onto main.

jhenderson added inline comments.Apr 4 2023, 12:06 AM
llvm/lib/Object/BuildID.cpp
21–23

Why have you changed this?

llvm/test/DebugInfo/symbolize-filter-markup-parse-fields.test
19–20

This check feels a bit fragile. Also, why has there been a behaviour change?

mysterymath marked 2 inline comments as done.

Update test case.

llvm/lib/Object/BuildID.cpp
21–23

To make the new code comply with the style guide: https://llvm.org/docs/CodingStandards.html#use-namespace-qualifiers-to-implement-previously-declared-functions
Since this is a refactoring change, I altered the existing definitions so the file would be internally consistent.

llvm/test/DebugInfo/symbolize-filter-markup-parse-fields.test
19–20

Different places that parsed build IDs disagreed on whether or not this was an error. I chose a semantics for build IDs consistent with the behavior of fromHex, since that appears to be the semantics generally used for hex->binary conversion.

Correct llvm-cov usage; update commit message.

mysterymath edited the summary of this revision. (Show Details)Apr 4 2023, 10:57 AM
mysterymath edited the summary of this revision. (Show Details)
jhenderson accepted this revision.Apr 5 2023, 12:40 AM

Looks good, with a couple of nits.

llvm/include/llvm/DebugInfo/Symbolize/MarkupFilter.h
17–18

Whilst you're working on this file, please delete the blank lines between the include lists. These prevent clang-format from reordering them automatically to match the LLVM style guide. (Either in this patch, or in a separate NFC commit, no need for review).

llvm/lib/Object/BuildID.cpp
21–23

Huh, I didn't know about that style guide entry. I have some issues with it, but that's a separate topic.

llvm/test/DebugInfo/symbolize-filter-markup-parse-fields.test
4–5

As as suggestion, now that you've expanded the CHECK-NOT lines, it would be good to indent the CHECK lines so that the error messages line up with the CHECK-NOT line errors, as demonstrated by the inline edit (you'd apply it to each CHECK line). This way, it'll be easier to spot by eye anywhere which differs unexpectedly.

This revision is now accepted and ready to land.Apr 5 2023, 12:40 AM
mysterymath marked 2 inline comments as done.

Update header and test style.

This revision was landed with ongoing or failed builds.Apr 5 2023, 11:25 AM
This revision was automatically updated to reflect the committed changes.