I am learning LLVM. I understand that thre are a number of useful C functions that are provided in LLVM already as intrinsic. So I'm trying to call the @printf function from my code.
I found the respective parts in the LLVM reference manual that describe the IR code to do that, which is relative clear:
declare i32 @printf(i8* noalias nocapture, ...)
call i32 (i8*, ...)* @printf(i8* %msg, i32 12, i8 42)
etc. But I am not able to find how to do that using the IRBuilder<> class. I checked the builder class but I wasn't able to figure anything out.
I don't want to pass any fancy variables, basically just something like
printf( "%lu", variable_64_bit );
in C or something like that.
Could anybody give me an idea what I must do to call the printf function through the builder.
Thanks in advance
I found an answer to this problem elsewhere. In fact it goes somewhat beyond my original question but it was helpful for me and hopefully it will help somebody else as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With