search for: ins_temp

Displaying 4 results from an estimated 4 matches for "ins_temp".

2013 Dec 16
3
[LLVMdev] Add call printf instructions problems
...i != e; i++,id++) { errs()<<"@"<<id<<": "<<*i<<"\n"; std::vector<llvm::Value*> paramArrayRef; Value *a = ConstantInt::get(Type::getInt32Ty(getGlobalContext()),1); paramArrayRef.push_back(a); // get an instruction pointer Instruction* ins_temp = &*i; //create a call instruction and insert it before every instruction CallInst *call_print = CallInst::Create(call_print,paramArrayRef,"",ins_temp); DEBUG(errs()<<"insert an instruction:"<<*call_print<<"\n"); } return true; } }; char call_...
2013 Dec 20
0
[LLVMdev] A problem about convert a string to a *i8 pointer
...uction in a .bc file,which prints the opcode of every instruction before the instruction executed. While passing the opcode to the printf fucntion ,I used such way to convert the string to i8* (the same as http://lists.cs.uiuc.edu/pipermail/llvmdev/2012-September/053206.html does): StringRef s = ins_temp->getOpcodeName(); //ins_temp is an Instruction* type Constant *to_be_print = ConstantDataArray::getString(ctx, s); GlobalVariable *g_print = new GlobalVariable(M, to_be_print->getType(), true, GlobalValue::InternalLinkage, to_be_print, "print_str"); Constant *zero = Constant::getN...
2013 Dec 16
0
[LLVMdev] Add call printf instructions problems
Hi Jin, It's difficult to say just from looking at a pass, but one thing looked odd: > CallInst *call_print = CallInst::Create(call_print,paramArrayRef,"",ins_temp); This looks very dodgy. The "call_print" being used as an argument is the (uninitialised) one that's just been declared. This could be the source of the assertion failure (though a segfault is just as likely). Other than that I'd suggest hooking up a debugger and going up the c...
2013 Dec 17
2
[LLVMdev] Add call printf instructions problems
...rename manipulation ? Thanks! 2013/12/16 Tim Northover <t.p.northover at gmail.com> > Hi Jin, > > It's difficult to say just from looking at a pass, but one thing looked > odd: > > > CallInst *call_print = > CallInst::Create(call_print,paramArrayRef,"",ins_temp); > > This looks very dodgy. The "call_print" being used as an argument is > the (uninitialised) one that's just been declared. This could be the > source of the assertion failure (though a segfault is just as likely). > > Other than that I'd suggest hooking up a...