<div dir="ltr"><div>Good point. I missed that you're using the C interface but it seems like similar functionality is available there:<br><span class="gmail-pl-smi">clang_getPointeeType</span><br><a href="https://github.com/llvm-mirror/clang/blob/master/include/clang-c/Index.h#L3437">https://github.com/llvm-mirror/clang/blob/master/include/clang-c/Index.h#L3437</a><br><br><span class="gmail-pl-smi">clang_getElementType</span><br><a href="https://github.com/llvm-mirror/clang/blob/master/include/clang-c/Index.h#L3513">https://github.com/llvm-mirror/clang/blob/master/include/clang-c/Index.h#L3513</a><br><br></div><div>Though, I couldn't find functionality to remove the qualifiers.<br><br></div><div>-Alex<br></div><div><br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-06-12 9:20 GMT+02:00 Sam Vanheer <span dir="ltr"><<a href="mailto:duo929@hotmail.com" target="_blank">duo929@hotmail.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">I was under the impression that any headers not in the clang-c directory<br>
are not part of the libClang API and cannot be used. Should i just<br>
include the headers from the clang C++ API as well then?<br>
<br>
<br>
Op 12/06/2017 om 0:41 schreef Alexander Droste:<br>
<div class="HOEnZb"><div class="h5">> Hi Sam,<br>
><br>
> here's one way which might work.<br>
> First, convert the CXType to a QualType with 'GetQualType'.<br>
><br>
> Combining 'getTypePtr'<br>
> <a href="https://github.com/llvm-mirror/clang/blob/master/include/clang/AST/Type.h#L653" rel="noreferrer" target="_blank">https://github.com/llvm-<wbr>mirror/clang/blob/master/<wbr>include/clang/AST/Type.h#L653</a><br>
><br>
><br>
> and 'getPointeeOrArrayElementType'<br>
> <a href="https://github.com/llvm-mirror/clang/blob/master/include/clang/AST/Type.h#L1946" rel="noreferrer" target="_blank">https://github.com/llvm-<wbr>mirror/clang/blob/master/<wbr>include/clang/AST/Type.h#L1946</a><br>
><br>
> should provide the unqualified pointee type.<br>
><br>
> Probably, you also want to ignore implicit casts<br>
> <a href="https://github.com/llvm-mirror/clang/blob/master/include/clang/AST/Expr.h#L727" rel="noreferrer" target="_blank">https://github.com/llvm-<wbr>mirror/clang/blob/master/<wbr>include/clang/AST/Expr.h#L727</a><br>
> .<br>
><br>
> The QualType can be converted back to a CXType with 'MakeCXType'<br>
> <a href="https://github.com/trolldbois/libclang/blob/master/CXType.cpp#L98" rel="noreferrer" target="_blank">https://github.com/trolldbois/<wbr>libclang/blob/master/CXType.<wbr>cpp#L98</a> .<br>
><br>
> -Alex<br>
><br>
> On 11.06.17 22:13, Sam Vanheer via cfe-dev wrote:<br>
>> I'm trying to get the name of method parameter and variable types, but<br>
>> the name returned by clang_getTypeSpelling contains part of the type as<br>
>> used, like "const", "&", etc.<br>
>><br>
>> Is there any way to use libClang's API to get just the name of the type,<br>
>> without any of these additions? I'm currently removing these from the<br>
>> name manually, but it seems superfluous when Clang already has it.<br>
>><br>
>> ______________________________<wbr>_________________<br>
>> cfe-dev mailing list<br>
>> <a href="mailto:cfe-dev@lists.llvm.org">cfe-dev@lists.llvm.org</a><br>
>> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/<wbr>mailman/listinfo/cfe-dev</a><br>
>><br>
<br>
</div></div></blockquote></div><br></div>