This is an archive of the discontinued LLVM Phabricator instance.

[Clang][LLVM] generate btf_tag annotations for DIGlobalVariable
ClosedPublic

Authored by yonghong-song on Jul 22 2021, 5:29 PM.

Details

Summary

Generate btf_tag annotations for DIGlobalVariable.
A field "annotations" is introduced to DIGlobalVariable, and
annotations are represented as an DINodeArray, similar to
DIComposite elements. The following example illustrates how
annotations are encoded in IR:

distinct !DIGlobalVariable(..., annotations: !10)
!10 = !{!11, !12}
!11 = !{!"btf_tag", !"a"}
!12 = !{!"btf_tag", !"b"}

Diff Detail

Event Timeline

yonghong-song created this revision.Jul 22 2021, 5:29 PM
yonghong-song requested review of this revision.Jul 22 2021, 5:29 PM
Herald added projects: Restricted Project, Restricted Project. · View Herald TranscriptJul 22 2021, 5:29 PM
  • add more cases in clang test attr-btf_tag-diglobalvariable.c
  • fix llvm/unittest failures.
dblaikie accepted this revision.Aug 20 2021, 10:39 AM

Sounds good.

(any chance have you measured/could you measure how much larger the bitcode for, say, an LLVM self-host Debug build gets with all these btf patches? (even without targeting/using btf, this is adding an extra field to lots of the debug info metadata, and I'd like to know whether that makes an observable difference in file size))

This revision is now accepted and ready to land.Aug 20 2021, 10:39 AM
This revision was landed with ongoing or failed builds.Aug 26 2021, 10:05 AM
This revision was automatically updated to reflect the committed changes.