[cfe-dev] I can't get the defined size

Rambo hunanlwm at sina.cn
Tue Dec 25 23:31:11 PST 2012


Hello,

This is some Program fragments for test:
 section 1:
bool conver(int a[],int b[])
{
   for(i=0;i<5;i++)
     a[i]=b[i];
}
section 2:
int main()
{
   int a[10];
   int num[5]={1,2,3,4,5};
  conver(a,num);
}
Now my problem is that I traverse them by some code as follows,i can't get
the defined size of array a and b.the reason is obvious,the section 1 is
traversed before section 2.I wonder someone can give me a better method to
break this trouble,thank you!

bool MyASTConsumer::HandleTopLevelDecl(DeclGroupRef d)
{
  typedef DeclGroupRef::iterator iter;
  for (iter b = d.begin(), e = d.end(); b != e; ++b)
  {
    rv.TraverseDecl(*b);
  }
  return true; // keep going
}




--
View this message in context: http://clang-developers.42468.n3.nabble.com/I-can-t-get-the-defined-size-tp4029189.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list