[LLVMdev] Problem with missing support for non-zero contant initializers.

Duncan Sands baldrick at free.fr
Mon Aug 20 12:03:08 PDT 2007


> > D allows static arrays up to 16MB in size. I'm initializing global
> > static arrays with a constant initializer. But D requires that (per
> > default) static arrays are initialized with the default initializer
> > for the element type. For float this happens to be NaN, so I cannot
> > use a 'zeroinitializer'.
> 
> Wow, this *is* bad.  I think the solution to this is to add a new 
> ConstantFillArray node.  It would always have array type, would take a 
> single Constant* value, and would give you the filled array with that 
> constant.  Please file a bug if you're interested.

In Ada, global variables should in general be default initialized to undef
(not zero) so this could also be useful for Ada.

Ciao,

Duncan.



More information about the llvm-dev mailing list