[LLVMdev] C interface

Gordon Henriksen gordonhenriksen at mac.com
Mon Sep 17 04:37:21 PDT 2007


On 2007-09-17, at 06:55, Ralph Corderoy wrote:

> Hi Gordon,
>
>>> I'm authoring a C interface to the LLVM IR type system.
>
> It's great to see a C interface being added.  A minor niggle:
>
>> +typedef enum {
>> +  LLVMVoidTypeKind = 0,    /* type with no size */
>> ...
>> +typedef enum {
>> +  LLVMExternalLinkage = 0,/* Externally visible function */
>> ...
>> +typedef enum {
>> +  LLVMDefaultVisibility = 0,  /* The GV is visible */
>
> It's defined by the language that the first enumerate's zero so the  
> initialisation is redundant.
>
> As someone reading the source, it would make me halt and wonder why  
> it's been done, "What am I missing?".

Most likely that these code blocks were copied and pasted from the C+ 
+ source which have the same attribute. :)

— Gordon

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20070917/73265112/attachment.html>


More information about the llvm-dev mailing list