A tiny documentation patch to LLVM Language Reference Manual

Rodney M. Bates rodney_bates at lcwb.coop
Sun Apr 13 08:19:11 PDT 2014


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.
-- 
Rodney Bates
rodney.m.bates at acm.org
-------------- next part --------------
--- LangRef.rst.~1~	2013-11-30 21:07:11.000000000 -0600
+++ LangRef.rst	2014-04-13 10:12:21.000000000 -0500
@@ -5177,7 +5177,7 @@
 
     define i32* @foo(%struct.ST* %s) {
       %t1 = getelementptr %struct.ST* %s, i32 1                 ; yields %struct.ST*:%t1
-      %t2 = getelementptr %struct.ST* %t1, i32 0, i32 2         ; yields %struct.RT*:%t2
+      %t2 = getelementptr %struct.ST %t1, i32 0, i32 2          ; yields %struct.RT:%t2
       %t3 = getelementptr %struct.RT* %t2, i32 0, i32 1         ; yields [10 x [20 x i32]]*:%t3
       %t4 = getelementptr [10 x [20 x i32]]* %t3, i32 0, i32 5  ; yields [20 x i32]*:%t4
       %t5 = getelementptr [20 x i32]* %t4, i32 0, i32 13        ; yields i32*:%t5


More information about the llvm-commits mailing list