[cfe-dev] nodes not appearing in AST?

Robert Anderson rwa at alumni.princeton.edu
Fri Jan 6 12:55:14 PST 2012

On Fri, Jan 6, 2012 at 12:31 PM, Eli Friedman <eli.friedman at gmail.com>wrote:

> On Fri, Jan 6, 2012 at 12:18 PM, David Blaikie <dblaikie at gmail.com> wrote:
> > I'm not sure if it's what the op was asking, but shouldn't the ast have
> > some node in the (uninstantiated template) that represents the
> > dependent call to too? Yet it seems printing the ast didn't show 'foo'
> > anywhere in the template by the looks of it. Is it perhaps just
> > something that's not printed by the ast pretty printing?
> From -ast-dump:
> void bar() (CompoundStmt 0x7fce3b058e28 <<stdin>:13:1, line:15:1>
>  (CallExpr 0x7fce3b058e00 <line:14:4, col:12> '<dependent type>'
>    (MemberExpr 0x7fce3b058dc8 <col:4, col:8> '<bound member function
> type>' .foo 0x7fce3b0583a0
>      (MemberExpr 0x7fce3b058d90 <col:4> 'struct A' lvalue ->m_a
> 0x7fce3b058920
>        (CXXThisExpr 0x7fce3b058d78 <col:4> 'B<T> *' this)))))
> -Eli

I may be running into problems/limitations with the python bindings to the
library.  When I dump an AST using that interface, I get nodes which seem
to map onto what you're showing here, but they have spelling "None" and
displayname of an empty string.

In the non-templated case they have spelling "None" but displayname "foo",
so I am able to find them.

Do you know what libclang call returns the text above which contained the
string "foo"?  It seems neither clang_getCursorSpelling nor
clang_getCursorDisplayname will in this case.

Thanks again,
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120106/bd3bbb79/attachment.html>

More information about the cfe-dev mailing list