[LLVMdev] [llvm-c] LLVMAttribute possible bug

Anton Korobeynikov anton at korobeynikov.info
Sun Feb 17 04:59:26 PST 2013


Hello

This is fine and intended. All this stuff works like bitmasks.

On Sun, Feb 17, 2013 at 4:30 PM, Moritz Maxeiner
<moritzmaxeiner at googlemail.com> wrote:
> While writing bindings to LLVM for another language via the c api I noticed
> that
> LLVMAlignment and LLVMStackAlignment do not use 1<<x like all the others,
> but 31<<x and 7<x respectively (see below, or here:
> http://llvm.org/docs/doxygen/html/Core_8h_source.html#l00148).
> It's likely this is as it is intended, but it does look out-of-place enough
> that
> I thought it might be a typo and I would like to know. Also, 1<<27 and 1<<28
> get skipped over from LLVMStackAlignment to LLVMReturnsTwice:
>
> LLVMZExtAttribute       = 1<<0,
> LLVMSExtAttribute       = 1<<1,
> LLVMNoReturnAttribute   = 1<<2,
> LLVMInRegAttribute      = 1<<3,
> LLVMStructRetAttribute  = 1<<4,
> LLVMNoUnwindAttribute   = 1<<5,
> LLVMNoAliasAttribute    = 1<<6,
> LLVMByValAttribute      = 1<<7,
> LLVMNestAttribute       = 1<<8,
> LLVMReadNoneAttribute   = 1<<9,
> LLVMReadOnlyAttribute   = 1<<10,
> LLVMNoInlineAttribute   = 1<<11,
> LLVMAlwaysInlineAttribute    = 1<<12,
> LLVMOptimizeForSizeAttribute = 1<<13,
> LLVMStackProtectAttribute    = 1<<14,
> LLVMStackProtectReqAttribute = 1<<15,
> LLVMAlignment = 31<<16,
> LLVMNoCaptureAttribute  = 1<<21,
> LLVMNoRedZoneAttribute  = 1<<22,
> LLVMNoImplicitFloatAttribute = 1<<23,
> LLVMNakedAttribute      = 1<<24,
> LLVMInlineHintAttribute = 1<<25,
> LLVMStackAlignment = 7<<26,
> LLVMReturnsTwice = 1 << 29,
> LLVMUWTable = 1 << 30,
>
>
>
> http://llvm.org/docs/doxygen/html/Core_8h_source.html#l00148
>
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev
>



--
With best regards, Anton Korobeynikov
Faculty of Mathematics and Mechanics, Saint Petersburg State University



More information about the llvm-dev mailing list