<div class="gmail_quote">On Mon, Jan 23, 2012 at 4:02 PM, Kostya Serebryany <span dir="ltr"><<a href="mailto:kcc@google.com">kcc@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br><br><div class="gmail_quote"><div><div class="h5">On Mon, Jan 23, 2012 at 3:19 PM, David Blaikie <span dir="ltr"><<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div><div>On Mon, Jan 23, 2012 at 3:16 PM, Chandler Carruth <<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>> wrote:<br>
> On Mon, Jan 23, 2012 at 3:04 PM, David Blaikie <<a href="mailto:dblaikie@gmail.com" target="_blank">dblaikie@gmail.com</a>> wrote:<br>
>><br>
>> On Mon, Jan 23, 2012 at 2:53 PM, Paul Robinson <<a href="mailto:pogo.work@gmail.com" target="_blank">pogo.work@gmail.com</a>><br>
>> wrote:<br>
>> > On Mon, Jan 23, 2012 at 1:45 PM, Kostya Serebryany <<a href="mailto:kcc@google.com" target="_blank">kcc@google.com</a>><br>
>> > wrote:<br>
>> >> There are 8 functions dealing with LLVMAttribute<br>
>> >> in include/llvm-c/Core.h.<br>
>> >> Do you suggest to add 8 more functions that will deal with uint64_t?<br>
>> >> Like this?<br>
>> >><br>
>> >> void LLVMAddFunctionAttr(LLVMValueRef Fn, LLVMAttribute PA);<br>
>> >> void LLVMAddFunctionAttr64(LLVMValueRef Fn, uint64_t PA);<br>
>> >><br>
>> >> --kcc<br>
>> ><br>
>> > With a more meaningful type name, e.g. LLVMAttribute64 or some such,<br>
>> > yes;<br>
>><br>
>> Given the constraints of the stable C API (binary compatibility)<br>
>> there's no way we can make this forwards compatible, is there?<br>
>> (passing a struct we could add elements to in the future - that would<br>
>> break binary compat, yes?)<br>
><br>
><br>
> You simply have to make the struct opaque, and only manipulated through API<br>
> calls. However that's pretty high cost.<br>
<br>
</div></div>Yeah - I was starting to see that. Pity - so we just add a new<br>
generation of API calls every time we reach the limit.<br></blockquote><div><br></div></div></div>So, do we go with <br>void LLVMAddFunctionAttribute64(LLVMValueRef Fn, uint64_t PA);<br><br>or with something more opaque like <br>
void LLVMAddFunctionAttribute(LLVMValueRef Fn, void *PAPtr);</div></blockquote><div><br></div><div>Typically you would go with something inbetween:</div><div><br></div><div>struct LLVMAttribute;</div><div>void LLVMAddFOOBARFunctionAttribute(LLVMValueRef Fn, LLVMAttribute *Attributes);</div>
<div><br></div><div>Then provide Add and Remove variations for all of the attributes, substituting the attribute name for FOOBAR.</div><div><br></div><div><br></div><div>I really don't know that this (very heavyweight approach) is the right way to go. I'd rather someone who is maintaining the LLVM C-APIs chime in, it may be that just upgrading the interfaces to 64-bit integers is "enough" for now.</div>
</div>