From a334d5f5355be5c26ea2d3c28456722afd1a4559 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Mon, 12 May 2008 23:51:09 +0000 Subject: [PATCH] Initial documentation for first-class aggregates changes. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@51013 91177308-0d34-0410-b5e6-96231b3b80d8 --- docs/LangRef.html | 116 ++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 116 insertions(+) diff --git a/docs/LangRef.html b/docs/LangRef.html index 38bcb02c3bb..694fed821e2 100644 --- a/docs/LangRef.html +++ b/docs/LangRef.html @@ -111,6 +111,12 @@
  • 'shufflevector' Instruction
  • +
  • Aggregate Operations +
      +
    1. 'extractvalue' Instruction
    2. +
    3. 'insertvalue' Instruction
    4. +
    +
  • Memory Access and Addressing Operations
    1. 'malloc' Instruction
    2. @@ -1030,6 +1036,8 @@ classifications:

      floating point, pointer, vector + structure, + array, @@ -2773,6 +2781,114 @@ operand may be undef if performing a shuffle from only one vector. + + + +
      + +

      LLVM supports several instructions for working with aggregate values. +

      + +
      + + + + +
      + +
      Syntax:
      + +
      +  <result> = extractvalue <aggregate type> <val>, <idx>{, <idx>}*
      +
      + +
      Overview:
      + +

      +The 'extractvalue' instruction extracts a value +from an aggregate value. +

      + + +
      Arguments:
      + +

      +The first operand of an 'extractvalue' instruction is a +value of struct or array +type. The operands are constant indicies to specify which value to extract +in the same manner as indicies in a +'getelementptr' instruction. +

      + +
      Semantics:
      + +

      +The result is the value at the position in the aggregate specified by +the index operands. +

      + +
      Example:
      + +
      +  %result = extractvalue {i32, float} %agg, i32 0    ; yields i32
      +
      +
      + + + + + +
      + +
      Syntax:
      + +
      +  <result> = insertvalue <aggregate type> <val>, <ty> <val>, i32 <idx>    ; yields <n x <ty>>
      +
      + +
      Overview:
      + +

      +The 'insertvalue' instruction inserts a value +into a aggregate. +

      + + +
      Arguments:
      + +

      +The first operand of an 'insertvalue' instruction is a +value of struct or array type. +The second operand is a first-class value to insert. +type of the first operand. The following operands are constant indicies +indicating the position at which to insert the value in the same manner as +indicies in a +'getelementptr' instruction. +The value to insert must have the same type as the value identified +by the indicies. + +

      Semantics:
      + +

      +The result is an aggregate of the same type as val. Its +value is that of val except that the value at the position +specified by the indicies is that of elt. +

      + +
      Example:
      + +
      +  %result = insertvalue {i32, float} %agg, i32 1, i32 0    ; yields {i32, float}
      +
      +
      + +