[LLVMdev] IO intrinsics?

Nick Lewycky nicholas at mxc.ca
Thu May 12 23:58:15 PDT 2011


On 05/12/2011 11:08 PM, 陳韋任 wrote:
> Hi, Hans
>
>> Since getchar and putchar are never defined, I'm assuming they are
>> intrinsics, but they are not documented with the rest of the intrinsics. So
>> are they intrinsics or something else?
>
>    I _guess_ standard functions like getchar/putchar are linked by
> default.

Indeed, they're coming from libc. The JIT will find any visible 
functions in the program it's running in (it calls dlsym() actually), so 
it finds putchar() just like C code finds putchar(). You can even 
declare your own extern "C" functions and the JIT will find those too.

Nick



More information about the llvm-dev mailing list