4 ms·
I think more than a C backend, LLVM needs "C as an IR". Which LLVM can internally use to "trivially" add support for embedded-type platforms that only have a C
by yazaddaruvala 11y ago
I think more than a C backend, LLVM needs "C as an IR". Which LLVM can internally use to "trivially" add support for embedded-type platforms that only have a C compiler.
That is what most people want it for anyways.
- mackwic 11y agoBackend is the correct term: C is by no mean an IR which means "intermediate representation", from which you can more or less easily understand the thing behind the code (eg: types, control flow, variable bindings). An IR is a data-structure that obey some rules, a C file is flat text that needs parsing. Not the same. If C is the output of the compiler, then we speak of a C Backend, which means the part that transform the final IR in the other language we want to translate to (eg: x86, arm6, sparc, ... C :) As a final note, it's likely that platforms so conservatives that they only provide a C ansi compiler, will not be aroused by Rust.
- ectoplasm 11y agoYou could reasonably do some for loop stuff using a C AST as your IR if you wanted. Not really sure why you would do this if coming from another language, but you could.