search for: convertedtext

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

2020 Jun 03
2
Fwd: I cannot change value of global variable in LLVM IR using IRBuilder
...uctionVisitor::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 (arg1) params.push_back(arg1); if (arg2) params.push_back(arg2); if (arg3) params.push_back(arg3); if (arg4) params.push_back(arg4); return Builder.CreateCall(printfFn, params); } return...
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",