[LLVMdev] Errata for "LLVM Assembly Language" docs (llvm.org/docs/LangRef.html)

Arthur O'Dwyer arthur.j.odwyer at gmail.com
Mon Nov 12 17:37:57 PST 2012


[Bcc: Chris Lattner, who's listed in the "Written by"; the doc doesn't
have a maintainer listed]

I was reading http://llvm.org/docs/LangRef.html today and found some
errors (or at least places where the text could be clearer). This is
*NOT* an exhaustive reading; I'm just reporting the bugs I found in a
casual reading of the intro and skimming the rest. I'm operating on
the theory that reporting even a small number of errata is better than
leaving them in forever.

(1) LangRef.html writes:
> Identifiers which require other characters in their names can be surrounded with quotes.
> Special characters may be escaped using "\xx" where xx is the ASCII code for the character
> in hexadecimal. In this way, any character can be used in a name value, even quotes themselves.

I would add an example to clarify where the quotation marks go, since
it's non-obvious. Like so:
> For example, the names %"a=b", %"a\3db", and %"a\3Db" all identify the same variable.

(2) LangRef.html writes:
> This last way of multiplying %X by 8 illustrates several important lexical features of LLVM:
>     Comments are delimited with a ';' and go until the end of line.
>     Unnamed temporaries are created when the result of a computation is not assigned to a named value.
>     Unnamed temporaries are numbered sequentially

The second two bullet points don't seem to be describing "lexical
features of LLVM"; they're describing semantic features of the Clang
LLVM backend. I think a more correct *and* more informative phrasing
would be
> This last way of multiplying %X by 8 illustrates several important lexical features of LLVM:
>     Comments are delimited with a ';' and go until the end of line.
>     The result of each (non-void) computation may be assigned to a variable, which may be named or unnamed.
>     By convention, unnamed temporary variables are numbered sequentially from %0.

(3) LangRef.html writes:
> If the unnamed_addr attribute is given, the address is know to not be significant and two identical functions can be merged.

s/know/known/

Thanks,
-Arthur



More information about the llvm-dev mailing list