From a334d5f5355be5c26ea2d3c28456722afd1a4559 Mon Sep 17 00:00:00 2001
From: Dan Gohman
LLVM supports several instructions for working with aggregate values. +
+ ++ <result> = extractvalue <aggregate type> <val>, <idx>{, <idx>}* ++ +
+The 'extractvalue' instruction extracts a value +from an aggregate value. +
+ + ++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. +
+ ++The result is the value at the position in the aggregate specified by +the index operands. +
+ ++ %result = extractvalue {i32, float} %agg, i32 0 ; yields i32 ++
+ <result> = insertvalue <aggregate type> <val>, <ty> <val>, i32 <idx> ; yields <n x <ty>> ++ +
+The 'insertvalue' instruction inserts a value +into a aggregate. +
+ + ++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. + +
+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. +
+ ++ %result = insertvalue {i32, float} %agg, i32 1, i32 0 ; yields {i32, float} ++