3 ms·
> This doesn't matter. Maybe I expressed myself a bit too literally, but I wouldn't say that how LLVM handles UB "doesn't matter." Look at how Clang compiles u
by dvt 6y ago
> This doesn't matter.
Maybe I expressed myself a bit too literally, but I wouldn't say that how LLVM handles UB "doesn't matter." Look at how Clang compiles undefined behavior vs GCC (for example)[1]. A bit tautological, but different ways of handling UB can lead to different ways UB behaves.
> LLVM IR is not C, and it is not convertible to C...
This isn't strictly true. There used to be an "official" C(pp) backend, which has been recently resurrected[2]. You can definitely go from LLVM to C -- probably won't be very readable, though.
[1] https://blog.llvm.org/posts/2011-05-21-what-every-c-programmer-should-know_21/ https://blog.llvm.org/posts/2011-05-21-what-every-c-programm...
[2] https://github.com/JuliaComputing/llvm-cbe https://github.com/JuliaComputing/llvm-cbe
- lambdatronics 6y ago> different ways of handling UB can lead to different ways UB behaves. Ha! If something depends on how 'undefined behavior' behaves, then it's not really undefined, is it? :D