A tiny documentation patch to LLVM Language Reference Manual

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Apr 22 12:51:20 PDT 2014


On 13 April 2014 11:19, Rodney M. Bates <rodney_bates at lcwb.coop> wrote:
> Attached is a -u patch to llvm-3.4/docs/LangRef.rst.  The type I have
> changed
> in this one-index-at-a-time form of the example contradicts the type given
> in
> the preceding, fully inlined multiple index form.
>
> I believe this one is the incorrect one, because, as stated, it looks to me
> like the following index operation would index the pointer again, advancing
> by two more struct.STs, rather than selecting an element of the struct.ST
> it already has.

No, the documentation is correct. The fact that we are not indexing is
represented by the first "i32 0" in the gep. Note that the IR would
not typecheck with the change since it has the type of %t2 explicitly
written down in:

 %t3 = getelementptr %struct.RT* %t2, i32 0, i32 1

Cheers,
Rafael



More information about the llvm-commits mailing list