You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Generating type definitions which will be used in generated LLVM programs currently causes problems. The generators were originally written under the assumption that a defined type is always equivalent to the fully normalized type (with no named types). This isn't true...
%name = type {i8}
%name2 = type {i8}
Named structure types are distinguished by name. So, %name, %name2, and {i8} are all considered to be different types.
Since we assumed otherwise before there are numerous places in the generator where using a named type causes problems. E.g., if we generate an expression of a named type we might generate a value of the unfolded type (given %name we might generate an {i8} instead). I've patched up a couple issues (I think) with regards to global constants, but more sneaky issues remain.
For instance extractvalue and insertvalue generators walk through a normalized type in order to find a path for indexing into a value. By normalizing the type, however, we lose the name information which can distinguish types later on, resulting in programs with type errors, e.g....:
%v44 = extractvalue <{<{%v1, float}>}> %v43, 0
%v48 = extractvalue <{{{{i8}, <{float, i64}>}, [0 x <2 x i32>], <3 x i64>}, float}> %v44, 0, 0, 1, 0
We lose the %v1 type distinction.
This is fixable, but we'll have to change how the paths are generated for these kinds of instructions.
The text was updated successfully, but these errors were encountered:
- Check structure types recursively for sized types
- Modify annotate function to pop stack.
- Add annotations for debugging to a lot of generators.
- Fix a bug in normalize_type_GenLLVM where pointer types were not
normalized fully.
- Add a note about #361
+ Originally had fixed the is_sized_type_alias parameter, but this
caused problems in other generators.
- Make normalized_typ_eq compare identifiers for types. This should
probably be improved further (rename the function + make this
follow identified type definitions when they're not
structures. Related to the #361 issue).
- Avoid using normalized types in a few generators.
- Add gen_exp_possibly_non_deterministic to generate calls (as we now
mark global pointers as non-deterministic).
- Fixed bug in gen_new_definition where function types would be
generated inside vector types.
Generating type definitions which will be used in generated LLVM programs currently causes problems. The generators were originally written under the assumption that a defined type is always equivalent to the fully normalized type (with no named types). This isn't true...
Named structure types are distinguished by name. So,
%name
,%name2
, and{i8}
are all considered to be different types.Since we assumed otherwise before there are numerous places in the generator where using a named type causes problems. E.g., if we generate an expression of a named type we might generate a value of the unfolded type (given
%name
we might generate an{i8}
instead). I've patched up a couple issues (I think) with regards to global constants, but more sneaky issues remain.For instance
extractvalue
andinsertvalue
generators walk through a normalized type in order to find a path for indexing into a value. By normalizing the type, however, we lose the name information which can distinguish types later on, resulting in programs with type errors, e.g....:We lose the
%v1
type distinction.This is fixable, but we'll have to change how the paths are generated for these kinds of instructions.
The text was updated successfully, but these errors were encountered: