diff options
Diffstat (limited to 'docs/LangRef.html')
-rw-r--r-- | docs/LangRef.html | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/docs/LangRef.html b/docs/LangRef.html index cac8fc79da..457a56ab0c 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -65,6 +65,7 @@ <li><a href="#globalconstants">Global Variable and Function Addresses</a></li> <li><a href="#undefvalues">Undefined Values</a></li> <li><a href="#constantexprs">Constant Expressions</a></li> + <li><a href="#metadata">Embedded Metadata</a></li> </ol> </li> <li><a href="#othervalues">Other Values</a> @@ -1847,6 +1848,14 @@ constants and smaller complex constants.</p> large arrays) and is always exactly equivalent to using explicit zero initializers. </dd> + + <dt><b>Metadata node</b></dt> + + <dd>A metadata node is a structure-like constant with the type of an empty + struct. For example: "<tt>{ } !{ i32 0, { } !"test" }</tt>". Unlike other + constants that are meant to be interpreted as part of the instruction stream, + metadata is a place to attach additional information such as debug info. + </dd> </dl> </div> @@ -2015,6 +2024,35 @@ following is the syntax for constant expressions:</p> </dl> </div> +<!-- ======================================================================= --> +<div class="doc_subsection"><a name="metadata">Embedded Metadata</a> +</div> + +<div class="doc_text"> + +<p>Embedded 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 type of an +empty struct and is identified in syntax by a preceding exclamation point +('<tt>!</tt>'). +</p> + +<p>A metadata string is a string surrounded by double quotes. It can contain +any character by escaping non-printable characters with "\xx" where "xx" is +the two digit hex code. For example: "<tt>!"test\00"</tt>". +</p> + +<p>Metadata nodes are represented with notation similar to structure constants +(a comma separated list of elements, surrounded by braces and preceeded by an +exclamation point). For example: "<tt>!{ { } !"test\00", i32 10}</tt>". +</p> + +<p>Optimizations may rely on metadata to provide additional information about +the program that isn't available in the instructions, or that isn't easily +computable. Similarly, the code generator may expect a certain metadata format +to be used to express debugging information.</p> +</div> + <!-- *********************************************************************** --> <div class="doc_section"> <a name="othervalues">Other Values</a> </div> <!-- *********************************************************************** --> |