3 ms·
> The IR code itself is "portable", but the C to IR compiler is using target specific information? Right. Consider how you'd compile something as simple as pri
by pcwalton 10y ago
> The IR code itself is "portable", but the C to IR compiler is using target specific information?
Right. Consider how you'd compile something as simple as printf("%d", (int)sizeof(int));
- exDM69 10y agoThe point still stands, but I think sizeof(int*) or sizeof(int) is a poor example, because it could be compiled to a portable "getelementptr" LLVM instruction. However, Clang does not do this and emits a constant integer for sizeof() operations (according to my quick and dirty test).