No way to create constants of named structure type #22

whitequark opened this Issue Mar 20, 2013 · 0 comments


None yet
1 participant

whitequark commented Mar 20, 2013

LLVM features disjoint named and unnamed type "name"spaces: { i32 } and %foo = type { i32 } are distinct and incompatible types. Further, the values of these types (as opposed to pointers to these values) cannot be bitcast one to another.

Currently, there is no way to create the following LLVM IR with ruby-llvm:

%foo = type { i32 }
@FOO = global %foo { i32 1 }

as the LLVM::ConstantStruct.const constructor implicitly creates an unnamed aggregate type derived from the types of its arguments.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment