-
Notifications
You must be signed in to change notification settings - Fork 11.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
18 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9dab912
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think a warning in resolveDIEReference will trigger, because it will exit in cloneDieReferenceAttribute.
Also what would be the test that would trigger this?
9dab912
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know how bolt works (I just tried to make a conservative change), but the simplest way to generate type signature references is to use clang's
-fdebug-types-section
flag.bin/clang -c -x c++ -o - - -g -fdebug-types-section <<<"struct A{} a;" | llvm-dwarfdump - -debug-info -v
will generate a reference toA
like this:Having said that, I now realize this only applies to type references, so if this code is never called on type references then there may not be a way to trigger it, and maybe this should be an assert instead (although you could still probably hit it with invalid/malformed dwarf -- I don't know what's bolt's policy here).
"supplementary" references are more elusive, and I don't think there's a way generate them using the llvm toolchain (the
dwz
tool might do that). To the best of my knowledge, no llvm tool (producer or consumer) actually supports working with these kinds of files, but in theory they could be used for almost any reference.9dab912
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does get called on type references, and we do have tests for it. I was referring to the else case that triggers a warning.
So sounds like that might get generated by dwz tool.
In the future please create a PR for your changes.
BOLT policy has evolved. Generally speaking we try to continue as much as possible while printing a warning, as not to block builds with BOLT failures related to debug information.
9dab912
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to fix the build breakage quickly and I got careless. Point taken.
Looking at this with a cooler head, I think I have now have a better fix. Please take a look at #99324.
(This also explains why this works with type units even though the original code was clearly broken for type units -- the function I changed really was not called for type unit. It's also not called for supplementary references, as those wouldn't make it past
cloneAttribute
).Ack.