Reputation: 9061
What I want to ask is that can we check a given instruction is containing an array as operand in LLVM. I am writing a pass and stuck at this phase.
Upvotes: 1
Views: 771
Reputation: 656
Yes, you can check this with following code:
Instruction *I;
bool UsingArray = false;
for (unsigned num = 0; num < I->getNumOperands(); ++num)
if (isa<ArrayType>(I->getOperand(num)->getType()))
UsingArray = true;
Upvotes: 2