aboutsummaryrefslogtreecommitdiff
path: root/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
diff options
context:
space:
mode:
authorYonghong Song <yhs@fb.com>2021-07-19 00:12:15 -0700
committerYonghong Song <yhs@fb.com>2021-08-20 12:06:37 -0700
commit430e22388173c96da6777fccb9735a6e8ee3ea1c (patch)
tree15010909dfcc7cff9ac17e8a1be2ca5478ea78a5 /llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
parent5425106e493e26f7e0a87077c8eca657a9aff293 (diff)
downloadllvm-430e22388173c96da6777fccb9735a6e8ee3ea1c.zip
llvm-430e22388173c96da6777fccb9735a6e8ee3ea1c.tar.gz
llvm-430e22388173c96da6777fccb9735a6e8ee3ea1c.tar.bz2
[DebugInfo] generate btf_tag annotations for DIDerived types
Generate btf_tag annotations for DIDrived types. More specifically, clang frontend generates the btf_tag annotations for record fields. The annotations are represented as an DINodeArray in DebugInfo. The following example illustrate how annotations are encoded in IR: distinct !DIDerivedType(tag: DW_TAG_member, ..., annotations: !10) !10 = !{!11, !12} !11 = !{!"btf_tag", !"a"} !12 = !{!"btf_tag", !"b"} Differential Revision: https://reviews.llvm.org/D106616
Diffstat (limited to 'llvm/lib/Bitcode/Writer/BitcodeWriter.cpp')
-rw-r--r--llvm/lib/Bitcode/Writer/BitcodeWriter.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
index 1d578a96..e3a6aba 100644
--- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -1687,6 +1687,8 @@ void ModuleBitcodeWriter::writeDIDerivedType(const DIDerivedType *N,
else
Record.push_back(0);
+ Record.push_back(VE.getMetadataOrNullID(N->getAnnotations().get()));
+
Stream.EmitRecord(bitc::METADATA_DERIVED_TYPE, Record, Abbrev);
Record.clear();
}