What is LLVM (Low-Level Virtual Machine)?
The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. Despite its name, LLVM has little to do with traditional virtual machines, though it does provide helpful libraries that can be used to build them.
LLVM began as a research project at the University of Illinois, with the goal of providing a modern, SSA-based compilation strategy capable of supporting both static and dynamic compilation of arbitrary programming languages. Since then, LLVM has grown to be an umbrella project consisting of a number of different subprojects, many of which are being used in production by a wide variety of commercial and open source projects as well as being widely used in academic research. Code in the LLVM project is licensed under the "UIUC" BSD-Style license.
What is Clang?
Clang is an LLVM front end for the C, C++, and Objective-C languages. Clang aims to provide a better user experience through expressive diagnostics, a high level of conformance to language standards, fast compilation, and low memory use. Like LLVM, Clang provides a modular, library-based architecture that makes it suitable for creating or integrating with other development tools. Clang is considered a production-quality compiler for C, Objective-C, C++ and Objective-C++ on x86 (32- and 64-bit), and for Darwin/ARM targets.
Now that you know what I ported, here is a little info about this project:
About 6-8 months ago, I tried to port LLVM and Clang to iOS using my iPod Touch 2g. That failed horribly, because my iPod didn't have nearly enough RAM required to port this. So, since I got my iPad 2 in December, I've decided to give it another go. This time, I was successful
. I have been working on this project on and off for a few weeks now, and it was the most difficult port for me so far, requiring changes in many things, from the configure script to Makefiles to source/header files in different languages and even other files that took a LOT of Googling to figure out. But the important thing is that we can now use the LLVM virtual machine and the Clang compiler on our devices
I have packaged this up and have uploaded it to the beta repo for now, located at https://ininjas.com/beta/
I do not expect you to run into many problems (if any), but if you do, please let me know so that I can fix them.
I have done some basic testing with Clang so far, and it seems to me like it is working properly. for those of you who are interested, here are the results of make check
Expected Passes : 5430
Expected Failures : 62
Unsupported Tests : 365
Unexpected Failures: 21
As you can see, this isn't perfect, but it is close enough for now. Only failing 21 tests out of a total of 5451 isn't shabby at all. It is probably due to me dropping support for a few of the architectures. Speaking of that, here are the supported architectures for this build of LLVM/Clang:
arm - ARM
ppc32 - PowerPC 32
ppc64 - PowerPC 64
sparc - Sparc
sparcv9 - Sparc V9
thumb - Thumb
x86 - 32-bit X86: Pentium-Pro and above
x86-64 - 64-bit X86: EM64T and AMD64
Once again, if you notice any problems/bugs while using either LLVM or Clang, PLEASE let me know about it so I may remedy the situation.