[cfe-dev] Question about TreeTransform

Andrew Gozillon via cfe-dev cfe-dev at lists.llvm.org
Tue Feb 21 13:36:41 PST 2017


Hi guys,


This might be a silly and naive question, but I was wondering if its at all possible for a type to change during a TreeTransform (I believe in general that's what the TreeTransform code is for but I could be incorrect)?


For example at the moment I have a Type that acts as a wrapper for another Type (alongside some extra information), however during transformation for the wrapper Type I would like to "transform" it to the contained Type. The contained type would be something like a pointer to another type and the wrapper in essence is a throw away class.


I've given it a try but when I swap out for the contained type I get a type size error "incorrect data size provided to CreateTypeSourceInfo!" within the TypeLocBuilder.h as the type sizes don't quite match up. Basically at this stage the TypeSourceInfo is that of the Wrapper with the contained type and the QualType itself is the contained type.


So in essence my questions are, is what I'm trying to do possible? If it is, am I perhaps missing a step within my own Transform function that's required to modify the type source information appropriately?


As perhaps useful information the TypeLoc class I've based the wrapper class off of is the TypeSpecTypeLoc class.


I'd be happy to provide more information or explain a little better for the sake of clarity, if that's required. As I'm unsure if this is enough information to go off of!


Thank you for your time.


Best Regards,

Andrew




Please consider the environment and think before you print.

The University of the West of Scotland is a registered Scottish charity. Charity number SC002520.

This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender.

Please note that any views or opinions presented in this email are solely those of the author and do not necessarily represent those of the University of the West of Scotland.

As a public body, the University of the West of Scotland may be required to make available emails as well as other written forms of information as a result of a request made under the Freedom of Information (Scotland) Act 2002.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170221/7159a3fc/attachment.html>


More information about the cfe-dev mailing list