Search code examples
cclangllvm

What can LLVM represent that C cannot?


As far as I know, it is almost true that any code that can be represented in the LLVM intermediate language, can also be represented in C, with two important exceptions:

  • Exceptions. (No pun intended.)
  • Signed integer arithmetic with well-defined behavior on overflow.

Is there anything else that can be represented in LLVM but not in C?


Solution

  • In addition to exception handling, other big features are garbage collection and out-of-the-box coroutines. Going to a lower level, there are trampoline intrinsics, patch points for JITs, and direct support for Obj-C ARC Runtime intrinsics.

    C is Turing complete, so all of these things can be introduced to C with libraries and so on, but I put them as they are part of the LLVM language.