llvm.org GIT mirror llvm / 45c5e8b
cleanups for the getresult section. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@48650 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 11 years ago
1 changed file(s) with 20 addition(s) and 17 deletion(s). Raw diff Collapse all Expand all
38983898
38993899
Syntax:
39003900

                  
                
3901 <resultval> = getresult <type> <retval>, <index>
3902
3901 <resultval> = getresult <type> <retval>, <index>
3902
3903
39033904
Overview:
39043905
39053906

The 'getresult' instruction is used to extract individual values

3906 from multiple values returned by a 'call'
3907 or 'invoke' instruction.
3908
3909
Arguments:
3910
3911 The 'getresult' instruction takes a return value as first argument.
3912 The value must have structure type. The second argument
3913 is an unsigned index value.
3914
3915
Semantics:
3916
3917 The 'getresult' instruction extracts the element identified by
3918 'index' from the aggregate value.
3907 from a 'call'
3908 or 'invoke' instruction that returns multiple
3909 results.

3910
3911
Arguments:
3912
3913

The 'getresult' instruction takes a call or invoke value as its

3914 first argument. The value must have structure type.
3915 The second argument is an unsigned index value which must be in range for
3916 the number of values returned by the call.

3917
3918
Semantics:
3919
3920

The 'getresult' instruction extracts the element identified by

3921 'index' from the aggregate value.

39193922
39203923
Example:
39213924
39233926 %struct.A = type { i32, i8 }
39243927
39253928 %r = call %struct.A @foo()
3926 %gr = getresult %struct.A %r, 0
3927 %gr1 = getresult %struct.A %r, 1
3929 %gr = getresult %struct.A %r, 0 ; yields i32:%gr
3930 %gr1 = getresult %struct.A %r, 1 ; yields i8:%gr1
39283931 add i32 %gr, 42
39293932 add i8 %gr1, 41
39303933