From cd1fd251ebfcc5e3d9bbbb6dda7ed921b28481bc Mon Sep 17 00:00:00 2001 From: Devang Patel Date: Mon, 11 Jan 2010 19:35:55 +0000 Subject: Add top level section for named metadata. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@93172 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.html | 43 +++++++++++++++++++++++++++++++++++-------- 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/docs/LangRef.html b/docs/LangRef.html index bc276ebe92..0a46e27bb8 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -43,6 +43,7 @@
  • Global Variables
  • Functions
  • Aliases
  • +
  • Named Metadata
  • Parameter Attributes
  • Function Attributes
  • Garbage Collector Names
  • @@ -85,12 +86,12 @@
  • Undefined Values
  • Addresses of Basic Blocks
  • Constant Expressions
  • -
  • Embedded Metadata
  • Other Values
    1. Inline Assembler Expressions
    2. +
    3. Metadata Nodes and Metadata Strings
  • Intrinsic Global Variables @@ -498,14 +499,19 @@ define i32 @main() { ; i32()* ; Call puts function to write out the string to stdout. call i32 @puts(i8 * %cast210) ; i32 - ret i32 0
    }
    + ret i32 0
    } + +; Named metadata +!1 = metadata !{i32 41} +!foo = !{!1, null}

    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".

    + "main" and named metadata + "foo".

    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.

    + +
    Syntax:
    +
    +
    +!1 = metadata !{metadata !"one"}
    +!name = !{null, !1}
    +
    +
    + +
    + @@ -2314,12 +2341,12 @@ has undefined behavior.

    -
    Embedded Metadata +
    -

    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 -- cgit v1.2.3