[cfe-dev] Get ArraySubcriptExpr

Zheng Wang jason.wangz at gmail.com
Sun May 8 01:15:08 PDT 2011


Hi Daniel,

The problem is that I don't know how many array subscription operations 'u'
has.

For example, for the following code:

u[i][j][k][m] = u[i][j+1][k][m-1] + u1[i][j]

The visitor function will be called many times and
ArraySubscriptExpr->getBase() won't always give me the correct base.

Cheers,
Zheng

On 7 May 2011 17:08, Daniel Schwartz-Narbonne <dstwo at princeton.edu> wrote:

> Couldn't you just write a simple function that calls your visitor in a
> loop, and pushes the results on a list that it returns?  Or am I
> misunderstanding the question?
>
>
> On Sat, May 7, 2011 at 7:53 AM, Zheng Wang <jason.wangz at gmail.com> wrote:
> > Hi,
> >
> > Assume I have the following statment:
> >
> > u[i][j+1][k][m] = a + b +c;
> >
> > How can I get all the 4 array subscription expessions at the same time? I
> > have tried the implement a VisitArraySubscriptExpr() funciton, but I can
> > only get each subscription expression each time.
> > This means I can only get i, j + 1, k, and m one by one.
> >
> > Is there any easy way to the all the subscription expressions at the same
> > time?
> >
> > Cheers,
> > Zheng
> >
> > _______________________________________________
> > cfe-dev mailing list
> > cfe-dev at cs.uiuc.edu
> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
> >
> >
>



-- 
Best regards,

WANG Zheng
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20110508/f279abf3/attachment.html>


More information about the cfe-dev mailing list