我正在学习LLVM.据我所知,在LLVM中提供的许多有用的C函数已经作为内在函数.所以我试图从我的代码中调用@printf函数.
我在LLVM参考手册中找到了描述IR代码的相应部分,这是相对清楚的:
declare i32 @printf(i8* noalias nocapture, ...)
call i32 (i8*, ...)* @printf(i8* %msg, i32 12, i8 42)
Run Code Online (Sandbox Code Playgroud)
但是我无法使用IRBuilder <>类找到如何做到这一点.我检查了构建器类,但我无法弄清楚任何事情.
我不想传递任何花哨的变量,基本上只是像
printf( "%lu", variable_64_bit );
Run Code Online (Sandbox Code Playgroud)
在C或类似的东西.
任何人都可以告诉我通过构建器调用printf函数必须做些什么.
提前致谢