mirror of
https://github.com/c3lang/c3c.git
synced 2026-02-27 12:01:16 +00:00
Improve infer conversions on constants, e.g. ZString a = foo ? "a" : "b"; #1561
This commit is contained in:
@@ -639,9 +639,8 @@ err_retblock: ; preds = %assign_optional4, %
|
||||
define ptr @test.bool_to_string(i8 zeroext %0) #0 {
|
||||
entry:
|
||||
%1 = trunc i8 %0 to i1
|
||||
%ternary = select i1 %1, %"char[]" { ptr @.str.10, i64 4 }, %"char[]" { ptr @.str.11, i64 5 }
|
||||
%2 = extractvalue %"char[]" %ternary, 0
|
||||
ret ptr %2
|
||||
%ternary = select i1 %1, ptr @.str.10, ptr @.str.11
|
||||
ret ptr %ternary
|
||||
}
|
||||
|
||||
; Function Attrs:
|
||||
|
||||
Reference in New Issue
Block a user