search for: getpointeroperandtype

Displaying 6 results from an estimated 6 matches for "getpointeroperandtype".

2011 Jan 22
2
[LLVMdev] Pointers in Load and Store
...ot;********operand is an instruction ****"; if (GetElementPtrInst *gepI = dyn_cast<GetElementPtrInst>(operandI)) { Out << "*** operand is a gep instruction ********"; if (const ArrayType *ar = dyn_cast<ArrayType>(gepI->getPointerOperandType()->getElementType())) hi=ar->getNumElements(); But this does not recognize that operand(0) of instruction I is even an instruction, let alone a get element pointer instruction. I have taken the code from line 632 and line 757 of safecode/lib/ArrayBoundsChecks/ArrayBoundCh...
2011 Jan 23
1
[LLVMdev] Pointers in Load and Store
....getOperand(0))) { Out<< "*** operand 0 is a constant Expr******"; if (CE->getOpcode() == Instruction::GetElementPtr) { Out<< "*** operand 0 is a gep instruction ********"; if (const ArrayType *ar = dyn_cast<ArrayType>(CE->getPointerOperandType()->getElementType())) hi=ar->getNumElements(); Thank you for that. I would like to use safecode programs rather than write my own code. However, the website of safecode says that it works only with version 2.6 or 2.7 of llvm whereas I use version 2.8 of llvm. To get around th...
2011 Jan 22
0
[LLVMdev] Pointers in Load and Store
...truction ****"; > if (GetElementPtrInst *gepI = > dyn_cast<GetElementPtrInst>(operandI)) > { Out<< "*** operand is a gep instruction ********"; > if (const ArrayType *ar = > dyn_cast<ArrayType>(gepI->getPointerOperandType()->getElementType())) > hi=ar->getNumElements(); > But this does not recognize that operand(0) of instruction I is even > an instruction, let alone a get element pointer instruction. I have > taken the code from line 632 and line 757 of > safecode/lib/Arra...
2011 Jan 12
1
[LLVMdev] newbi to llvm - how to get array size
Hi, I am new to llvm to so please be kind to me if I am asking something that is too simple. I want to get the bounds of an array when I have a handle to getelementptr or insertelement or extractvalue instructions. I am writing a translation routine from llvm to a non-deterministic language and want to include array bounds check in it. The array size gets printed as part of the type of the
2011 Jan 21
0
[LLVMdev] Pointers in Load and Store
On 1/20/2011 10:02 PM, Surinder wrote: > When I compile C programs into llvm, it produces load instructions in > two different flavours. > > (1) %8 = load i8** %bp, align 8 > > (2) %1 = load i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, > i64 0), align 1 > > I know that %bp in first case and the entire "getelementptr inbounds > ([4 x i8]* @.str, i64
2011 Jan 21
2
[LLVMdev] Pointers in Load and Store
When I compile C programs into llvm, it produces load instructions in two different flavours. (1) %8 = load i8** %bp, align 8 (2) %1 = load i8* getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0), align 1 I know that %bp in first case and the entire "getelementptr inbounds ([4 x i8]* @.str, i64 0, i64 0)" in second case can be obtained by dump'ing I.getOperand(0)