[LLVMdev] New support for variable argument functions & intrinsic functions
sabre at nondot.org
Thu May 8 14:46:00 PDT 2003
Two new features are now supported by LLVM:
1. Intrinsic functions. These are a cheap and easy way to extend LLVM
to support target-specific or other useful features without mangling
the LLVM language. If you are interested in this, check out:
The new Function::getIntrinsicID() method and llvm/Intrinsics.h file
defines a simple interface to identify if a function is calling an
intrinsic function and what it is. No LLVM passes should need to be
modified ever to support intrinsic functions (assuming they treat
external functions calls in a conservative fashion).
2. Variable argument handling support. It is now possible to write
printf in LLVM! This is the last big feature that LLVM has been
missing that has prevented it from compiling "any old" C program.
Specifically, support has been added for the C <stdarg.h> header.
This involved the addition of three new intrinsics and a new LLVM
va_arg instruction. These are documented here:
Support for variable argument functions has been added to LLI, the C
backend, and the X86 JIT. The _new_ C front-end also generates
these correctly. A testcase has been checked in here:
Let me know if you have any questions or concerns.
More information about the llvm-dev