[DebugInfo] generate btf_tag annotations for func parameters

Generate btf_tag annotations for function parameters.
A field "annotations" is introduced to DILocalVariable, and
annotations are represented as an DINodeArray, similar to
DIComposite elements. The following example illustrates how
annotations are encoded in IR:
    distinct !DILocalVariable(name: "info",, arg: 1, ..., annotations: !10)
    !10 = !{!11, !12}
    !11 = !{!"btf_tag", !"a"}
    !12 = !{!"btf_tag", !"b"}

Differential Revision: https://reviews.llvm.org/D106620
This commit is contained in:
Yonghong Song
2021-07-19 09:11:10 -07:00
parent 7309359928
commit 1bebc31c61
11 changed files with 140 additions and 59 deletions

View File

@@ -1994,6 +1994,7 @@ void ModuleBitcodeWriter::writeDILocalVariable(
Record.push_back(N->getArg());
Record.push_back(N->getFlags());
Record.push_back(N->getAlignInBits());
Record.push_back(VE.getMetadataOrNullID(N->getAnnotations().get()));
Stream.EmitRecord(bitc::METADATA_LOCAL_VAR, Record, Abbrev);
Record.clear();