[llvm-commits] CVS: llvm/docs/GetElementPtr.html

Reid Spencer reid at x10sys.com
Mon Aug 14 21:00:43 PDT 2006



Changes in directory llvm/docs:

GetElementPtr.html updated: 1.7 -> 1.8
---
Log message:

Okay, make the prose match the example too.


---
Diffs of the changes:  (+8 -7)

 GetElementPtr.html |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)


Index: llvm/docs/GetElementPtr.html
diff -u llvm/docs/GetElementPtr.html:1.7 llvm/docs/GetElementPtr.html:1.8
--- llvm/docs/GetElementPtr.html:1.7	Mon Aug 14 22:57:05 2006
+++ llvm/docs/GetElementPtr.html	Mon Aug 14 23:00:29 2006
@@ -78,12 +78,13 @@
   AType* Foo;
   ...
   X = &Foo->F;</pre>
-  <p>it is natural to think that there is only one index, the constant value
-  <tt>1</tt>. This results from C allowing you to treat pointers and arrays as
-  equivalent. LLVM doesn't. In this example, Foo is a pointer. That pointer must
-  be indexed. To arrive at the same address location as the C code, you would
-  provide the GEP instruction with two indices. The first indexes through the
-  pointer, the second index the element of the structure just as if it was:</p>
+  <p>it is natural to think that there is only one index, the selection of the
+  field <tt>F</tt>.  However, in this example, <tt>Foo</tt> is a pointer. That 
+  pointer must be indexed explicitly in LLVM. C, on the other hand, indexs
+  through it ransparently.  To arrive at the same address location as the C 
+  code, you would provide the GEP instruction with two index operands. The 
+  first operand indexes through the pointer; the second operand indexes the 
+  field <tt>F</tt> of the structure, just as if you wrote:</p>
   <pre>
   X = &Foo[0].F;</pre>
   <p>Sometimes this question gets rephrased as:</p>
@@ -629,7 +630,7 @@
   <a href="http://validator.w3.org/check/referer"><img
   src="http://www.w3.org/Icons/valid-html401" alt="Valid HTML 4.01!" /></a>
   <a href="http://llvm.org">The LLVM Compiler Infrastructure</a><br/>
-  Last modified: $Date: 2006/08/15 03:57:05 $
+  Last modified: $Date: 2006/08/15 04:00:29 $
 </address>
 </body>
 </html>






More information about the llvm-commits mailing list