[llvm-commits] CVS: llvm/www/docs/LangRef.html

Chris Lattner lattner at cs.uiuc.edu
Fri Dec 13 00:02:01 PST 2002


Changes in directory llvm/www/docs:

LangRef.html updated: 1.19 -> 1.20

---
Log message:

getelementptr uses long instead of uint indexes


---
Diffs of the changes:

Index: llvm/www/docs/LangRef.html
diff -u llvm/www/docs/LangRef.html:1.19 llvm/www/docs/LangRef.html:1.20
--- llvm/www/docs/LangRef.html:1.19	Mon Nov  4 18:21:03 2002
+++ llvm/www/docs/LangRef.html	Fri Dec 13 00:01:21 2002
@@ -490,7 +490,7 @@
 <i>; Definition of main function</i>
 int "main"() {                                                       <i>; int()* </i>
         <i>; Convert [13x sbyte]* to sbyte *...</i>
-        %cast210 = <a href="#i_getelementptr">getelementptr</a> [13 x sbyte]* %.LC0, uint 0, uint 0 <i>; sbyte*</i>
+        %cast210 = <a href="#i_getelementptr">getelementptr</a> [13 x sbyte]* %.LC0, long 0, long 0 <i>; sbyte*</i>
 
         <i>; Call puts function to write out the string to stdout...</i>
         <a href="#i_call">call</a> int %puts(sbyte* %cast210)                              <i>; int</i>
@@ -1401,7 +1401,7 @@
 
 <h5>Syntax:</h5>
 <pre>
-  <result> = getelementptr <ty>* <ptrval>{, uint <aidx>|, ubyte <sidx>}*
+  <result> = getelementptr <ty>* <ptrval>{, long <aidx>|, ubyte <sidx>}*
 </pre>
 
 <h5>Overview:</h5>
@@ -1411,7 +1411,7 @@
 
 <h5>Arguments:</h5>
 
-This instruction takes a list of <tt>uint</tt> values and <tt>ubyte</tt>
+This instruction takes a list of <tt>long</tt> values and <tt>ubyte</tt>
 constants that indicate what form of addressing to perform.  The actual types of
 the arguments provided depend on the type of the first pointer argument.  The
 '<tt>getelementptr</tt>' instruction is used to index down through the type
@@ -1444,7 +1444,7 @@
 %ST = type { int, double, %RT }
 
 int* "foo"(%ST* %s) {
-  %reg = getelementptr %ST* %s, uint 1, ubyte 2, ubyte 1, uint 5, uint 13
+  %reg = getelementptr %ST* %s, long 1, ubyte 2, ubyte 1, long 5, long 13
   ret int* %reg
 }
 </pre>
@@ -1453,7 +1453,7 @@
 
 The index types specified for the '<tt>getelementptr</tt>' instruction depend on
 the pointer type that is being index into.  <a href="t_pointer">Pointer</a> and
-<a href="t_array">array</a> types require '<tt>uint</tt>' values, and <a
+<a href="t_array">array</a> types require '<tt>long</tt>' values, and <a
 href="t_struct">structure</a> types require '<tt>ubyte</tt>'
 <b>constants</b>.<p>
 
@@ -1473,11 +1473,11 @@
 
 <pre>
 int* "foo"(%ST* %s) {
-  %t1 = getelementptr %ST* %s , uint 1                        <i>; yields %ST*:%t1</i>
-  %t2 = getelementptr %ST* %t1, uint 0, ubyte 2               <i>; yields %RT*:%t2</i>
-  %t3 = getelementptr %RT* %t2, uint 0, ubyte 1               <i>; yields [10 x [20 x int]]*:%t3</i>
-  %t4 = getelementptr [10 x [20 x int]]* %t3, uint 0, uint 5  <i>; yields [20 x int]*:%t4</i>
-  %t5 = getelementptr [20 x int]* %t4, uint 0, uint 13        <i>; yields int*:%t5</i>
+  %t1 = getelementptr %ST* %s , long 1                        <i>; yields %ST*:%t1</i>
+  %t2 = getelementptr %ST* %t1, long 0, ubyte 2               <i>; yields %RT*:%t2</i>
+  %t3 = getelementptr %RT* %t2, long 0, ubyte 1               <i>; yields [10 x [20 x int]]*:%t3</i>
+  %t4 = getelementptr [10 x [20 x int]]* %t3, long 0, long 5  <i>; yields [20 x int]*:%t4</i>
+  %t5 = getelementptr [20 x int]* %t4, long 0, long 13        <i>; yields int*:%t5</i>
   ret int* %t5
 }
 </pre>
@@ -1487,7 +1487,7 @@
 <h5>Example:</h5>
 <pre>
   <i>; yields [12 x ubyte]*:aptr</i>
-  %aptr = getelementptr {int, [12 x ubyte]}* %sptr, uint 0, ubyte 1
+  %aptr = getelementptr {int, [12 x ubyte]}* %sptr, long 0, ubyte 1
 </pre>
 
 
@@ -1706,7 +1706,7 @@
 <address><a href="mailto:sabre at nondot.org">Chris Lattner</a></address>
 <!-- Created: Tue Jan 23 15:19:28 CST 2001 -->
 <!-- hhmts start -->
-Last modified: Mon Nov  4 18:20:38 CST 2002
+Last modified: Fri Dec 13 00:00:57 CST 2002
 <!-- hhmts end -->
 </font>
 </body></html>





More information about the llvm-commits mailing list