[cfe-dev] [libClang] Get name of method parameter or variable type

Jonathan Müller via cfe-dev cfe-dev at lists.llvm.org
Mon Jun 12 02:40:16 PDT 2017


On 12.06.2017 11:37, Alexander Droste via cfe-dev wrote:
> Good point. I missed that you're using the C interface but it seems 
> like similar functionality is available there:
> clang_getPointeeType
> https://github.com/llvm-mirror/clang/blob/master/include/clang-c/Index.h#L3437
>
> clang_getElementType
> https://github.com/llvm-mirror/clang/blob/master/include/clang-c/Index.h#L3513
>
> Though, I couldn't find functionality to remove the qualifiers.
>
> -Alex

You have to get somewhat creative for that: 
https://github.com/foonathan/cppast/blob/master/src/libclang/type_parser.cpp#L459-L643

In particular: 
https://github.com/foonathan/cppast/blob/master/src/libclang/type_parser.cpp#L163-L183
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170612/d9a4200b/attachment.html>


More information about the cfe-dev mailing list