diff options
author | Reid Spencer <rspencer@reidspencer.com> | 2006-08-15 04:00:29 +0000 |
---|---|---|
committer | Reid Spencer <rspencer@reidspencer.com> | 2006-08-15 04:00:29 +0000 |
commit | eda573ddf988b34799e4ac76779ed63a570454e0 (patch) | |
tree | a4a7870604b842b53e8d385a52fecff588cadac4 /docs/GetElementPtr.html | |
parent | 1c6f87d665502fb4481435970eacafb59c200ce0 (diff) | |
download | external_llvm-eda573ddf988b34799e4ac76779ed63a570454e0.zip external_llvm-eda573ddf988b34799e4ac76779ed63a570454e0.tar.gz external_llvm-eda573ddf988b34799e4ac76779ed63a570454e0.tar.bz2 |
Okay, make the prose match the example too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29697 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'docs/GetElementPtr.html')
-rw-r--r-- | docs/GetElementPtr.html | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/docs/GetElementPtr.html b/docs/GetElementPtr.html index 49c3e65..08d8006 100644 --- a/docs/GetElementPtr.html +++ b/docs/GetElementPtr.html @@ -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> |