Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

LLVM bitcode cross-platform

Tags:

People also ask

Is LLVM cross platform?

LLVM IR can be cross-platform, with the obvious exceptions others have listed. However, that does not mean Clang generates cross-platform code. As you note, the preprocessor is almost universally used to only pass parts of the code to the C/C++ compiler, depending on the platform.

Is LLVM IR platform independent?

You can think of LLVM IR as a platform-independent assembly language with an infinite number of function local registers. When developing compilers there are huge benefits with compiling your source language to an intermediate representation (IR) 1 instead of compiling directly to a target architecture (e.g. x86).

What is LLVM IR Bitcode?

What is commonly known as the LLVM bitcode file format (also, sometimes anachronistically known as bytecode) is actually two things: a bitstream container format and an encoding of LLVM IR into the container format. The bitstream format is an abstract encoding of structured data, very similar to XML in some ways.


Just to be sure: Is LLVM bitcode cross-platform? By which I mean, can the generated IR (".bc") file be distrubuted and interpreted/JITed over various platforms?

If so, how does Clang convert C++ into platform independend code? While in the C++ language itself, preprocessors for determining it's target platform are used before it actually compiles.