search for: addgetelementptrchecks

Displaying 3 results from an estimated 3 matches for "addgetelementptrchecks".

2011 Jan 23
1
[LLVMdev] Pointers in Load and Store
...quot;unGep", "Breaks Constant GEPs" (3) The new pass derives from FunctionPass (because safecode does so, if I had to write it, ModulePass would have been good enough.) (4) The RunOnFunction method of the unGep pass invokes addPoolChecks(F) passing it the function F. I will modify addGetElementPtrChecks so that it produces array bounds in the way I need. (I need a check that array bounds are being voilated for my reaserch to detect overflows.) I will then run opt as opt -load../unGep.so to produce llvm code without geps as operands. Please advise if this will work or if there is an easier way....
2011 Jan 22
0
[LLVMdev] Pointers in Load and Store
...iled in several years now). The file you want to look at is in lib/InsertPoolChecks/insert.cpp. This file contains the InsertPoolChecks pass which, in mainline SAFECode, is responsible for inserting array bounds checks and indirect function call checks. In particular, you want to look at the addGetElementPtrChecks() method. As for Constant Expression GEPs, you want to look at the BreakConstGEP pass, located in lib/ArrayBoundsChecks/BreakConstantGEPs.cpp. The BreakConstantGEP pass is run first. All it does is find instructions that use constant expression GEPs and replaces the Constant Expression GEP w...
2011 Jan 22
2
[LLVMdev] Pointers in Load and Store
John, I have looked at the SAFECode and thought following sould work if (isa<Constant>(I.getOperand(0))) { Out << "*** operand 0 is a constant ******"; if (Instruction *operandI = dyn_cast<Instruction>(I.getOperand(0))) { Out << "********operand is an instruction ****"; if (GetElementPtrInst *gepI =