[cfe-dev] From QualType to clang::NamedDecl?
Reid Kleckner
rnk at google.com
Tue Mar 17 09:14:03 PDT 2015
Use Ty->getAsTagDecl() to get the TagDecl if it is one.
On Tue, Mar 17, 2015 at 6:38 AM, Jay Wang <frefire at gmail.com> wrote:
> Hi all:
>
> I am wondering if there is an interface for locating clang::NamedDecl for
> a QualType?
> example:
> struct foo { int a; int b; };
> void bar(struct foo param);
>
> From ASTConsumer::HandleTopLevelDecl, I can get a QualType of struct foo
> as a paramter from function bar, so how do I track back to the definition
> of foo, which has a type of clang::NamedDecl?
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150317/c75b4da8/attachment.html>
More information about the cfe-dev
mailing list