[LLVMdev] Getting Started
sabre at nondot.org
Tue Jul 20 23:19:47 PDT 2004
On Tue, 20 Jul 2004, Sriraman Tallam wrote:
> New to LLVM and I want to try some sample programs and build on them.
> Any pointers to where I can find small projects ?
It depends on what you are looking for. If you're looking for examples of
C++ code that manipulates LLVM code, there are lots of things in the
source tree depending on what you want to do (browse around in tine
llvm/lib tree). If you have specific questions, this list is a great
place to ask.
If you're looking for sample programs to compile with LLVM and see what
they look like, check out the llvm/test/Programs hierarchy. It is filled
with tons of programs of various sizes that do all sorts of things. If
you are looking for small programs, check out test/Programs/SingleSource/,
and specifically Benchmarks/Shootout has a bunch of small programs. If
you're looking for larger programs, the MultiSource directory contains
various applications and benchmark suites that may be of interest.
In any of the test/Programs directories, if you type 'make' in a
directory, it will recurse to any subdirectories. In any application
directory it will build the application with LLVM (native, JIT, and C
backend) and the native compiler, execute the results and diff the
If you want to just build the LLVM bytecode without executing the
programs, you can use the 'make bytecode' target to avoid executing the
programs. In any case, the end LLVM result for a program will be named
"Output/programname.llvm.bc" in a directory. You can use llvm-dis to
inspect the LLVM instructions for it that way.
Another thing to point out is that you can download random applications
and compile them with LLVM too. Usually 'configure CC=llvmgcc
CXX=llvmg++; make' is all you need.
More information about the llvm-dev