Hacker News new | ask | show | jobs
by Philpax 589 days ago
LLVM is a backend: it takes LLVM IR (intermediate representation) and generates machine code.

This is a frontend: it takes C and generates its own IR (a simplified version of C).

You could glue these together with an adapter from CIL to LLVM IR to get a complete C compiler.

Clang is both a frontend and a complete compiler in this respect: the Clang frontend compiles C to LLVM IR, and these are bundled together to produce the Clang compiler.

(Note: I'm simplifying things here. Clang and LLVM are more intertwined than these, and there are several nuances I'm not covering; I'm going for a high-level perspective here)

1 comments

High-level is good enough for me for the beginning, thanks!