Getting Started With LLVM Wrapper
- Checkout latest source via SVN
- Compile setstdio.c for your target platform using Clang. (The command line compile for this function is given in the file "build.sh".)
- Copy and paste stdio.llh into your LLVM Assembly file.
- Use the functions as documented below or listed in the source. (Take care to look up the order with regards to which parameters take FILE pointers in the setstdio.c sources and which take zero terminated strings. They are each listed in the header as i8* (pointer to bytes).)
- Assemble your bitcodes normally using llvm-as.
- Link any other bitcode files other than setstdio.bc to make a whole-program bitcode file.
- Invoke opt on your whole-program bitcode using standard optimizations if you want optimal code.
- Transfer your whole-program bitcode to the destination platform. (The following instructions should be executed by the packager or by the installer program.)
- Link your whole-program bitcode to setstdio.bc with llvm-link.
- Invoke opt on your newly created complete bitcode file using link-time optimizations.
- Run the complete bitcode file through llc.
- Assemble the resultant native assembly code with your native assembler (normally GNU as) if your platform doesn't support direct code emission.
- Link the resultant object file to LibC using the system linker (normally GNU ld) if your assembler doesn't automatically do so.
- The executable emitted should be able to execute normally.
LLVM Wrapper Documentation
Functions implemented and their descriptions
Consult the User's Guide for information on using the wiki software.