Identify array type in IR
问题 I have been trying to identify array access in IR by making use of following code: for (BasicBlock::iterator ii = BB->begin(), ii2; ii != BB->end(); ii++) { Instruction *I=ii; if(GetElementPtrInst *getElePntr = dyn_cast<GetElementPtrInst>(&*I)) { Value *valAlloc = (getElePntr->getOperand(0)); if(getElePntr->getOperand(0)->getType()->isArrayTy()) { errs()<<"\tarray found"; } } } This code identifies getElementPtr instruction but it does not identify whether it's first operand is an array type