search for: printffn

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

Did you mean: printfn
2020 Jun 03
2
Fwd: I cannot change value of global variable in LLVM IR using IRBuilder
...Builder.CreateLoad(key); Value* inc = Builder.CreateAdd(load, Builder.getInt64(1)); StoreInst* store = Builder.CreateStore(inc, key); return store; } return I; } Instruction* InstructionVisitor::print(Instruction* I, const char* text, Value* arg1, Value* arg2, Value* arg3, Value* arg4) { Function* printfFn = I->getModule()->getFunction("printf"); if (printfFn) { IRBuilder<> Builder(I->getContext()); Builder.SetInsertPoint(I->getNextNode()); Value* convertedText = Builder.CreateGlobalStringPtr(text); std::vector <Value *> params; params.push_back(convertedText); if (...
2020 Jun 03
2
Fwd: I cannot change value of global variable in LLVM IR using IRBuilder
Hi Everyone, I'm quite new to LLVM and I want to update value of global variable in LLVM IR. I created new global variable in ModulePass: bool runOnModule(llvm::Module &M) { IRBuilder<> Builder(M.getContext()); Instruction *I = &*inst_begin(M.getFunction("main")); Builder.SetInsertPoint(I); M.getOrInsertGlobal("globalKey",