开发者

print function name pass in llvm

I'd like to insert a function call (printf) in the first basic block of every functio开发者_开发百科n, which prints the function name. Please be specific how can I do that. The difficult part is that I don't know how to pass the function name as a parameter to printf.


This is pretty straightforward: you will need to grab the name of the function, create ConstantArray in your module (check ConstantArray::get() method described e.g. in http://llvm.org/docs/doxygen/html/classllvm_1_1ConstantArray.html) containing the name of your function and pass this array to printf() call.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜