[cfe-dev] Find Type by name

Artem Dergachev via cfe-dev cfe-dev at lists.llvm.org
Wed Feb 28 12:36:31 PST 2018


I don't think it's possible via straightforward lookup - you might need 
to scan the AST to do this.

Eg. using ASTMatchers:

     qualType(asString("my_nm::my_type<int, 10u>"))

Or, if you're not using ASTMatchers (likely), you can do the same with a 
RecursiveASTVisitor. Or manually.

On 27/02/2018 10:56 AM, Roman Popov via cfe-dev wrote:
> Hello,
>
> Is it possible to find type in AST by it's qualified type?
>
> For example I have string "my_nm::my_type<int, 10u>", how can I get 
> clang::QualType if type is present in translation unit?
>
> Thanks,
> Roman
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev




More information about the cfe-dev mailing list