[LLVMdev] Functions with unnamed parameters in LLVM IR
Dan Liew
dan at su-root.co.uk
Fri Aug 15 02:53:20 PDT 2014
> I did mean the LangRef, but probably not there, and not to that degree.
For documentation I think being explicit is much better than being implicit.
> It's a fairly minor point, perhaps warranting a sentence where unnamed
> values are generally discussed and the basic-block case is mentioned
> (under the "Identifiers" section).
I took a look at the "Identifiers" section [1]. There isn't any
mention of the basic-block case there. In any case I don't think this
is the appropriate place. Perhaps I've given you the wrong impression
about what I want to document.
What I want to documented is the fact that in a function definition,
arguments can be unnamed and that unnamed arguments are assigned to
temporary registers using the function's counter. The logical place to
discuss that is [2] (if I was a new user of LLVM and I wanted to know
about function arguments I wouldn't go looking at the identifiers
section). The entry block being assigned "%0" is discussed here too so
I could correct that as well.
On a separate note whilst looking at the Language reference I did
observe think a few things were odd
- We seem to mix the terms argument and parameter. Functions seem to
have arguments, but those arguments have "parameter attributes"
- We sort of use backus naur form to show the IR syntax but we don't
define things like "argument list" (what I'm trying to document), "ret
attrs", "fn Attrs". For "ret attrs" and "fn Attrs" we define what the
attributes are but we don't define the form of the list (i.e. space
separated).
[1] http://llvm.org/docs/LangRef.html#identifiers
[2] http://llvm.org/docs/LangRef.html#functions
More information about the llvm-dev
mailing list