From cd1fd251ebfcc5e3d9bbbb6dda7ed921b28481bc Mon Sep 17 00:00:00 2001
From: Devang Patel This example is made up of a global variable named
- ".LC0", an external declaration of the "puts" function, and
+ ".LC0", an external declaration of the "puts" function,
a function definition for
- "main".
}
+ ret i32 0
}
+
+; Named metadata
+!1 = metadata !{i32 41}
+!foo = !{!1, null}
In general, a module is made up of a list of global values, where both functions and global variables are global values. Global values are @@ -911,6 +917,27 @@ define [linkage] [visibility] + +
Named metadata is a collection of metadata. Metadata + node and null are the only valid named metadata operands. + Metadata strings are not allowed as an named metadata operand.
+ ++!1 = metadata !{metadata !"one"} +!name = !{null, !1} ++
Embedded metadata provides a way to attach arbitrary data to the instruction +
Metadata provides a way to attach arbitrary data to the instruction stream without affecting the behaviour of the program. There are two metadata primitives, strings and nodes. All metadata has the metadata type and is identified in syntax by a preceding exclamation @@ -2338,8 +2365,8 @@ has undefined behavior.
event that a value is deleted, it will be replaced with a typeless "null", such as "metadata !{null, i32 10}". -A named metadata is a collection of metadata nodes. For example: "!foo = - metadata !{!4, !3}". +
A named metadata is a collection of + metadata nodes. For example: "!foo = metadata !{!4, !3}".
Optimizations may rely on metadata to provide additional information about the program that isn't available in the instructions, or that isn't easily -- 2.34.1