[LLVMdev] How to create a CallInst that calls a standard c function like "printf"
rich at rd.gen.nz
Thu Jan 21 10:40:11 PST 2010
On Tue, Jan 19, 2010 at 2:08 AM, Mary_nju <miaoyisz at gmail.com> wrote:
> I am working on a program based on LLVM. I want to modify the .bc file
> throught C++ APIs provided by LLVM, but I don't know how to create a
> CallInst that calls a standard c function like "printf", can anyone help me
> with this problem?
A good way to work this kind of thing out is to use the online demo
application and look at the C++ code that it prints out when you
* Go to http://llvm.org/demo/
* Click "Show LLVM C++ API code"
* Click "Compile Source Code"
Search the code for "printf" and you should be able to easily see how
it is used.
More information about the llvm-dev