This question is similar to Ryan Lefever's post on May 1, 2006 about
printf declaration. In my case, I want to insert fprintf(stderr,
...) calls. I'm new to LLVM, and I don't know what's the recipe for
putting together the arguments. Can someone give me basic
instructions or point me in the direction on what to do? I can't find
any more documentation on this. Thanks!
Another question in reference to Ryan's post, can someone explain the
purpose of this code, in particular the last 4 lines? Are the
duplicate lines intentional?
/* m is Module*, f is Function*, i is Instruction* */
Constant* constStr = ConstantArray::get("test\n");
GlobalVariable* gv = new GlobalVariable
(constStr->getType(), true, GlobalValue::InternalLinkage, constStr,
Constant* gep = ConstantExpr::getGetElementPtr(gv,geplist);