llvm-hs-pretty icon indicating copy to clipboard operation
llvm-hs-pretty copied to clipboard

Handle named references in structs correctly

Open jcpetruzza opened this issue 3 years ago • 0 comments

The added test-case would previously fail since:

; ModuleID = 'simple module'

%struct.coord2d = type {i32, i32}
%struct.vector = type {%struct.coord2d, %struct.coord2d}

@up = global %struct.vector {%struct.coord2d {i32 0, i32 0}, %struct.coord2d {i32 0, i32 1}}

would get pretty-printed as invalid code:

; ModuleID = 'simple module'

%struct.coord2d = type {i32, i32}
%struct.vector = type {%struct.coord2d, %struct.coord2d}

@up = global %struct.vector {%struct.coord2d zeroinitializer, {i32 0, i32 0} {i32 0, i32 1}}

To run the tests, I had to update the nix support, that had bitrot

jcpetruzza avatar Apr 24 '22 23:04 jcpetruzza