Displaying 2 results from an estimated 2 matches for "getsourceelementtyp".
Did you mean:
getsourceelementtype
2016 Aug 12
2
Check if getElementPtr Operand
Hello,
consider the following IR code :
%count4 = getelementptr inbounds %struct.r32, %struct.r32* %cur.087, i64 0,
i32 4
How to check in the instruction, whether the operand is a structure or not
if(isa<GetElementPtrInst>(instruction))
{
GetElementPtrInst *getElementPtrInst=dyn_cast<GetElementPtrInst>(&instruction);
//check if getElemetPtrInst operands structure or array.
}
2016 Aug 31
2
Check if getElementPtr Operand
Thanks Ryan, I'm able to retrieved the type using the following code:
Type *type=getElementPtrInst->getSourceElementType();
On Fri, Aug 12, 2016 at 7:00 PM, Ryan Taylor <ryta1203 at gmail.com> wrote:
> Take a look at visitGetElementPtrInst in InstructionCombining.cpp for some
> examples about how to iterate over GEP and check for type.
>
> http://llvm.org/docs/doxygen/html/InstructionCombining_...