[cfe-dev] how to get array size from an array decl ?

illiop via cfe-dev cfe-dev at lists.llvm.org
Fri Oct 19 02:04:38 PDT 2018


Hello,
 
if the program is :
 
void foo()
{
   int a[3] = {0,1,2};
}
 
If I get the ast nodes by the ast matcher:  varDecl(hasType(arrayType()))
I will get  int a[3] matched, the matched node is a VarDecl type.
How can I get the array size (in this example is 3) from the VarDecl node ?
 
Thank you for any help !
 
Anders
 
  
 
 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20181019/9aabd718/attachment.html>


More information about the cfe-dev mailing list