Jochen Wilhelmy
2011-Mar-06 18:45 UTC
[LLVMdev] sharing of constants across modules allowed?
Hi! is it allowed to create a constant and use it as operand for instructions in differend modules (but same context)? -Jochen
Frits van Bommel
2011-Mar-06 18:53 UTC
[LLVMdev] sharing of constants across modules allowed?
On Sun, Mar 6, 2011 at 7:45 PM, Jochen Wilhelmy <j.wilhelmy at arcor.de> wrote:> is it allowed to create a constant and use it as operand for > instructions in differend modules (but same context)?As long as it doesn't contain any references to global values (functions, global variables & constants and aliases), yes. For example: 'i32 0' is fine, as is 'i8* inttoptr (i32 1234 to i8*)', but not 'i32(i8*, ...)* @printf'. Basically, if it contains an '@' (i.e. anything with a named memory address) anywhere then it's not allowed, otherwise it's fine.