[PATCH] D106304: [LangRef] Clarify support for multiple metadata attachments with same id
Teresa Johnson via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jul 19 13:19:14 PDT 2021
This revision was landed with ongoing or failed builds.
This revision was automatically updated to reflect the committed changes.
Closed by commit rG54c8902f0236: [LangRef] Clarify support for multiple metadata attachments with same id (authored by tejohnson).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D106304/new/
https://reviews.llvm.org/D106304
Files:
llvm/docs/LangRef.rst
Index: llvm/docs/LangRef.rst
===================================================================
--- llvm/docs/LangRef.rst
+++ llvm/docs/LangRef.rst
@@ -5035,8 +5035,8 @@
Metadata
========
-LLVM IR allows metadata to be attached to instructions in the program
-that can convey extra information about the code to the optimizers and
+LLVM IR allows metadata to be attached to instructions and global objects in the
+program that can convey extra information about the code to the optimizers and
code generator. One example application of metadata is source-level
debug information. There are two metadata primitives: strings and nodes.
@@ -5096,6 +5096,9 @@
%indvar.next = add i64 %indvar, 1, !dbg !21
+Instructions may not have multiple metadata attachments with the same
+identifier.
+
Metadata can also be attached to a function or a global variable. Here metadata
``!22`` is attached to the ``f1`` and ``f2`` functions, and the globals ``g1``
and ``g2`` using the ``!dbg`` identifier:
@@ -5110,6 +5113,9 @@
@g1 = global i32 0, !dbg !22
@g2 = external global i32, !dbg !22
+Unlike instructions, global objects (functions and global variables) may have
+multiple metadata attachments with the same identifier.
+
A transformation is required to drop any metadata attachment that it does not
know or know it can't preserve. Currently there is an exception for metadata
attachment to globals for ``!type`` and ``!absolute_symbol`` which can't be
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D106304.359889.patch
Type: text/x-patch
Size: 1479 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210719/e2a5ca92/attachment.bin>
More information about the llvm-commits
mailing list