[cfe-dev] Indexer Library and type references....
Douglas Gregor
dgregor at apple.com
Mon Oct 5 15:04:11 PDT 2009
On Oct 5, 2009, at 6:41 AM, dan chap wrote:
> --- On Tue, 9/29/09, Argyris Kyrtzidis <akyrtzi at gmail.com> wrote:
> Type references in declarations are now tracked by the Indexer
> library.
> Note, though, that type references in expressions are not tracked
> because type source information for exprs (like sizeof/alignof) is
> not preserved in the AST yet.
>
> I'd appreciate any feedback that you may have!
>
> -Argiris
> Argiris,
>
> Yay! That is great news! I will get the latest svn today...
>
> Still, for my purposes, _every_ reference needs to be preserved.
> In order to do massive refactoring of the original source code such
> as shifting namespaces left or right,
Shifting namespaces sounds like a syntactic transformation rather than
a transformation that needs to work on the AST.
> even the sizeof() would be needed..... I will give some better
> feedback next week.
>
> In the mean time, could not a sizeof() be treated like a cast in the
> AST?
Yes, it can. For every place that a type shows up in the expression or
statement grammar, the corresponding Expr or Stmt node will need to
maintain type location information (probably in a TypeSpecLoc). As far
as I can tell, all of the infrastructure is there, but someone will
need to go through and add this information for us to maintain all
type source information for expressions and statements.
- Doug
More information about the cfe-dev
mailing list