[cfe-dev] Tracing Typedef Chain

mats petersson via cfe-dev cfe-dev at lists.llvm.org
Mon Nov 23 09:05:30 PST 2015


If you call `getTypePtr` it should give you the "next" type.

--
Mats

On 23 November 2015 at 16:27, Daniel Dilts via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> If I have code like this:
>
> typedef int X;
> typedef X Y;
> typedef Y Z;
>
> Z i = 0;
>
> I have the QualType for i.  getAsString() returns "Z".
> getCanonicalType().getAsString() returns "int".
>
> Is there some way to trace the typedef chain such that I get "Z", "Y",
> "X", and "int"?  Order is not particularly important to me, but it would be
> nice to get them in that order.
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20151123/b1ed6ca9/attachment.html>


More information about the cfe-dev mailing list