我正在修复TinyGo编译器中的一些错误。目前,我有一个奇怪的问题与比特率。IR代码如下所示:
%structcast.go.A = type { i32, i32, i32, i32 }
%structcast.go.B = type { i32, i32, i32, i32 }
...
%0 = load %structcast.go.B, %structcast.go.B* %b, !dbg !1851
%changetype = bitcast %structcast.go.B %0 to %structcast.go.A, !dbg !1852
call void @structcast.go.foo(%structcast.go.A %changetype, i8* undef, i8* undef), !dbg !1853但在IR验证期间,我得到:
Invalid bitcast
%changetype = bitcast %structcast.go.B %0 to %structcast.go.A, !dbg !1852我在想,那个比特秀到底是非法的吗?
发布于 2019-01-31 17:53:47
好吧,我自己弄明白了:强制转换必须是一个非聚合类型,而struct是聚合的:(
https://stackoverflow.com/questions/54452189
复制相似问题