Closed hikari-no-yume closed 3 years ago
Trivial example of what this change does:
; Function Attrs: norecurse nounwind readnone ssp uwtable
define i32 @main(i32 %0, i8** nocapture readnone %1) local_unnamed_addr #0 {
ret i32 0
}
int main(int argc, char ** argv) {
uint32_t _1 = (uint32_t)argc;
uint8_t** _2 = (uint8_t**)argv;
return 0;
}
Without this change, it looks like:
uint32_t main(uint32_t _1, uint8_t** _2) {
return 0;
}
Because the argument types are wrong, GCC and Clang refuse to compile it without special flags. They also warn about the wrong return type.
A fix for part of https://github.com/JuliaComputing/llvm-cbe/issues/98, as discussed there.
I hope the code is self-explanatory.