[llvm-dev] Wrong description about getelementptr arguments?

陳韋任 via llvm-dev llvm-dev at lists.llvm.org
Sat Jun 17 06:09:17 PDT 2017


Hi All,

  While reading "Arguments" section of getelementptr [1], the description
is a little wired to me.

    The first argument is always a type used as the basis for the
calculations. The second argument
    is always a pointer or a vector of pointers, and is the base address to
start from.

    ...

    The first index always indexes the pointer value given as the first
argument, ...

Here I see the paragraph says the first argument is a *type*, then says the
first index always indexes
*the pointer value* given as the first argument. From getelementptr FAQ
[2], I feel the first arguement
(first operand in FAQ) should be *the pointer value*, and the following
sentence seems not so right to
me.

    The first argument is always a type used as the basis for the
calculations.

Am I reading it wrong, or it is wrong. Thanks.

[1] http://llvm.org/docs/LangRef.html#getelementptr-instruction
[2] http://llvm.org/docs/GetElementPtr.html

Regards,
chenwj

-- 
Wei-Ren Chen (陳韋任)
Homepage: https://people.cs.nctu.edu.tw/~chenwj
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170617/16f3d7fc/attachment.html>


More information about the llvm-dev mailing list