[LLVMdev] how to zero-init a global

Jochen Wilhelmy j.wilhelmy at arcor.de
Sun Mar 6 12:52:16 PST 2011


Hi!

I have a module containing a constant e.g.

@input = global %0 zeroinitializer, align 16

when I copy the global into another module I use
newGlobal->copyAttributesFrom(global);
but the new module now has

@input = external global %0, align 16

i.e. the zeroinitializer is missing. how do I set it or
copy it from the other global?

-Jochen




More information about the llvm-dev mailing list