[LLVMdev] C interface

Ralph Corderoy ralph at inputplus.co.uk
Mon Sep 17 03:55:02 PDT 2007


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?".
Similar to seeing a `static int foo = 0'.

Cheers,


Ralph.




More information about the llvm-dev mailing list