Comment

Comment by Philpax

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)

parent Philpax 2 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton