diff options
author | Peter Collingbourne <peter@pcc.me.uk> | 2017-01-25 21:50:14 +0000 |
---|---|---|
committer | Peter Collingbourne <peter@pcc.me.uk> | 2017-01-25 21:50:14 +0000 |
commit | 7b5b7c74440285814fc5c4c4d2206a1d18857ddf (patch) | |
tree | 706b13f126a1c15c4782875d88b1d035f35d0f1e /llvm/docs | |
parent | bfe02642da7b860c210e57a1505a7d81f5414112 (diff) | |
download | bcm5719-llvm-7b5b7c74440285814fc5c4c4d2206a1d18857ddf.tar.gz bcm5719-llvm-7b5b7c74440285814fc5c4c4d2206a1d18857ddf.zip |
LangRef: Document the allowed metadata dropping transforms.
Document the current practice regarding dropping metadata on modules,
functions and global variables.
Differential Revision: https://reviews.llvm.org/D29110
llvm-svn: 293101
Diffstat (limited to 'llvm/docs')
-rw-r--r-- | llvm/docs/LangRef.rst | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/llvm/docs/LangRef.rst b/llvm/docs/LangRef.rst index ba15713429f..ecf48455427 100644 --- a/llvm/docs/LangRef.rst +++ b/llvm/docs/LangRef.rst @@ -3941,15 +3941,28 @@ to the ``add`` instruction using the ``!dbg`` identifier: %indvar.next = add i64 %indvar, 1, !dbg !21 -Metadata can also be attached to a function definition. Here metadata ``!22`` -is attached to the ``foo`` function using the ``!dbg`` 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: .. code-block:: llvm - define void @foo() !dbg !22 { + declare !dbg !22 void @f1() + define void @f2() !dbg !22 { ret void } + @g1 = global i32 0, !dbg !22 + @g2 = external global i32, !dbg !22 + +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 +unconditionally dropped unless the global is itself deleted. + +Metadata attached to a module using named metadata may not be dropped, with +the exception of debug metadata (named metadata with the name ``!llvm.dbg.*``). + More information about specific metadata nodes recognized by the optimizers and code generator is found below. |