search for: printf_func

Displaying 2 results from an estimated 2 matches for "printf_func".

2013 Nov 26
0
[LLVMdev] Help needed with a pass
...Module* mod = new Module(getGlobalContext()); Function* strncpy_func = cast<Function>(mod->getOrInsertFunction(new StringRef("strncpy"), Type::getInt32Ty(getGlobalContext()), Type::getInt32Ty(getGlobalContext()), Type::getInt32Ty(getGlobalContext()), NULL)); Function* printf_func = cast<Function>(mod->getOrInsertFunction(new StringRef("printf"), Type::getInt32Ty(getGlobalContext()), NULL)); Constant* c = mod->getOrInsertFunction(new StringRef("foo"),Type::getInt32Ty(getGlobalContext()),NULL); Function* foo = cast<Function&gt...
2013 Dec 16
3
[LLVMdev] Add call printf instructions problems
...; func->setCallingConv(llvm::CallingConv::C); return func; } //get a printf function Function* Get_print() { llvm::LLVMContext& ctx = llvm::getGlobalContext(); Module* mod = new Module("test",ctx); // Constant* c = mod->getOrInsertFunction("printf"); Function *printf_func = printf_prototype(ctx, mod); printf_func->setCallingConv(CallingConv::C); return printf_func; } virtual bool runOnFunction(Function &F) { int id = 0; // get a Function Function *call_print = Get_print(); for(inst_iterator i = inst_begin(F),e = inst_end(F);i != e; i++,id++) { errs()<<...