<div>Hi,</div>
<div> </div>
<div>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.</div>

<div> </div>
<div>The array size gets printed as part of the type of the value <pty> </div>
<div> </div>
<div><result> = getelementptr inbounds <pty>* <ptrval> (ty idx)</div>
<div> </div>
<div>I am wrongly expecting I.getOperand(0)->getType()->getNumElements() to give me the array size (after casting ptrval to array type)</div>
<div> </div>
<div>I am not getting the array size, I am getting a value of zero.</div>
<div> </div>
<div>Can someone point out to me how to get array size (number of elements in the array) from the type object.  What about multi-dimension arrays too.</div>
<div> </div>
<div>Thanks.</div>
<div> </div>
<div>Surinder Kumar Jain</div>