[LLVMdev] Two new 'llvmnotes'
nicholas at mxc.ca
Sun Apr 27 12:49:18 PDT 2008
Chris Lattner wrote:
> 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.
What's wrong with using insert/extractelement for arrays and structs as
well as vectors? They're all sequence types.
>> 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 :)
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu http://llvm.cs.uiuc.edu
More information about the llvm-dev