On Wed, Dec 5, 2012 at 6:23 PM, TROUVE Antoine <span dir="ltr"><<a href="mailto:trouve@isit.or.jp" target="_blank">trouve@isit.or.jp</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello everybody<br>
<br>
I would like to know how to access to all the dimensions of an array with more than one dimension from its Decl object<br>
In other words, if I have the type "int[42][51]", I would like to get both the "42" and the "51".<br>
<br>
I figured out how to do so with a single-dimension using an ASTContext, but not for multiple dimensions yet.</blockquote><div><br></div><div>Use getAsConstantArrayType to get the ConstantArrayType* and extract the first dimension. Then, use getElementType() on the ConstantArrayType to get the element type, and use getAsConstantArrayType on that. Lather, rinse, repeat as needed. </div>
</div>