[llvm-commits] [llvm] r51013 - /llvm/trunk/docs/LangRef.html

Dan Gohman gohman at apple.com
Fri May 23 15:01:39 PDT 2008


On May 23, 2008, at 2:09 PM, Chris Lattner wrote:

> On May 12, 2008, at 4:51 PM, Dan Gohman wrote:
>> URL: http://llvm.org/viewvc/llvm-project?rev=51013&view=rev
>> Log:
>> Initial documentation for first-class aggregates changes.
>
> Nice,
>
>> +<h5>Example:</h5>
>> +
>> +<pre>
>> +  %result = extractvalue {i32, float} %agg, i32 0    <i>; yields  
>> i32</i>
>> +</pre>
>> +</div>
>
> Since the indices are constants, not "Value*"'s, I don't think there  
> should be a type specified for them.  Something like:
>
> %result = extractvalue {{i32, float}} %agg, 0, 1
>
> Should be enough.

Currently the indices are Value*'s though. As Value*'s they are
more consistent with getelementptr, and to some degree extractelement.
Making them plain constants would make extractvalue/insertvalue a
little simpler though, so I could be convinced :-).

>
>
>> +<!--  
>> _______________________________________________________________________ 
>>  -->
>> +<div class="doc_subsubsection">
>> +   <a name="i_insertvalue">'<tt>insertvalue</tt>' Instruction</a>
>> +</div>
>> ++<h5>Arguments:</h5>
>> +
>> +<p>
>> +The first operand of an '<tt>insertvalue</tt>' instruction is a
>> +value of <a href="#t_struct">struct</a> or <a  
>> href="#t_array">array</a> type.
>> +The second operand is a first-class value to insert.
>
>> +type of the first operand.
>
> Sentence fragment?

Fixed.

>
>
>> The following operands are constant indicies
>
> If they aren't value*'s, please don't call them operands.
>
>> +<h5>Example:</h5>
>> +
>> +<pre>
>> +  %result = insertvalue {i32, float} %agg, i32 1, i32 0    <i>;  
>> yields {i32, float}</i>
>
> Also, no types please.

If we change to plain constant indices, I'll update these.

> Should the discussion of first-class types and other type  
> classifications be updated?

There was some wording about structs and arrays needing to be
referenced via loads and stores. I removed it.

Thanks,

Dan




More information about the llvm-commits mailing list