[LLVMdev] Two new 'llvmnotes'

Chris Lattner sabre at nondot.org
Sun Apr 27 12:38:42 PDT 2008


On Apr 27, 2008, at 10:58 AM, Talin wrote:

> I would certainly make use of this in my frontend.
>
> I suggest the names "getfield" and "setfield" for the two operations,
>

I agree that 'get/insertvalue' are pretty generic, and am welcome to  
suggestions.  Get/set *field* imply that this applies only to structs,  
but it also works with arrays.  I would actually prefer get/insert  
*element* but insertelement is already taken.

> since (to me anyway) "insert" implies adding something new, as opposed
> to overwriting an existing value.

The logic for using insert is that it replaces an element and produces  
the new aggregate as a whole, it doesn't update something in place  
(which set implies, at least to me).  'insert' is also useful because  
of its analogy with 'insertelement', the vector instruction.

One nice thing about get/setvalue is that they are short :)

-Chris



More information about the llvm-dev mailing list