This is an archive of the discontinued LLVM Phabricator instance.

[BPF] preserve btf_decl_tag for parameters of extern functions
ClosedPublic

Authored by eddyz87 on Jan 4 2023, 4:56 AM.

Details

Summary

Generate DILocalVariable entries for parameters of extern functions,
the "annotations" field of DILocalVariable is used to link
"btf_decl_tag" annotation with the parameter.

Do this only for BPF backend as there are no other users for this
information. Final DWARF is valid as "Appendix A" is very much lax in
what is allowed as attributes for "DW_TAG_formal_parameter":

DWARF does not in general require that a given debugging information
entry contain a particular attribute or set of attributes. Instead,
a DWARF producer is free to generate any, all, or none of the
attributes ... other attributes ... may also appear in a given
debugging information entry.

DWARF Debugging Information Format Version 5,
Appendix A: Attributes by Tag Value (Informative)
Page 251, Line 3.

Depends on D140969

Diff Detail

Event Timeline

eddyz87 created this revision.Jan 4 2023, 4:56 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 4 2023, 4:56 AM
eddyz87 published this revision for review.Jan 4 2023, 5:15 AM
eddyz87 added a reviewer: yonghong-song.
Herald added a project: Restricted Project. · View Herald TranscriptJan 4 2023, 5:15 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript
eddyz87 updated this revision to Diff 486295.Jan 4 2023, 8:01 AM

Fix for formatting issue reported by CI.

yonghong-song accepted this revision.Jan 6 2023, 10:53 PM

LGTM. I will add // REQUIRES: bpf-registered-target in the test to ensure it only executed with bpf target.

This revision is now accepted and ready to land.Jan 6 2023, 10:53 PM