diff options
author | Yonghong Song <yhs@fb.com> | 2021-07-19 09:11:10 -0700 |
---|---|---|
committer | Yonghong Song <yhs@fb.com> | 2021-08-26 14:18:30 -0700 |
commit | 1bebc31c617d1a0773f1d561f02dd17c5e83b23b (patch) | |
tree | c97eaff78d0fe1c3d096b61e88fa653ff7bb7195 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | |
parent | 73093599287cc6d546ac46652ee781789d7de61f (diff) | |
download | llvm-1bebc31c617d1a0773f1d561f02dd17c5e83b23b.zip llvm-1bebc31c617d1a0773f1d561f02dd17c5e83b23b.tar.gz llvm-1bebc31c617d1a0773f1d561f02dd17c5e83b23b.tar.bz2 |
[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
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r-- | llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index d012733..a7061c6 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -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(); |