<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On 21 February 2017 at 13:36, Andrew Gozillon via cfe-dev <span dir="ltr"><<a href="mailto:cfe-dev@lists.llvm.org" target="_blank">cfe-dev@lists.llvm.org</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">




<div dir="ltr">
<div id="m_8502573363288333964divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p>Hi guys,</p>
<p><br>
</p>
<p>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)?</p></div></div></blockquote><div>Yes, that's permitted. If you want to do so, you generally need to override the relevant Transform*Type function, and be sure to populate the TypeLocBuilder with location information for the new type. (Overriding Rebuild*Type to produce a different type will in general not work, since the type location information will be populated for the wrong type, leading to the assertion you describe below.)</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div id="m_8502573363288333964divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p>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.
<br>
</p>
<p><br>
</p>
<p>I've given it a try but when I swap out for the contained type I get a type size error <span>"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.</span></p>
<p><span><br>
</span></p>
<p><span>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? </span></p></div></div></blockquote><div>It sounds like you are not populating the type source information for your wrapper type properly within the TypeLocBuilder. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div id="m_8502573363288333964divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p><span>As perhaps useful information the TypeLoc class I've based the wrapper class off of is the TypeSpecTypeLoc class. 
<br>
</span></p>
<p><span><br>
</span></p>
<p><span>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!</span></p></div></div></blockquote><div>If the above hints aren't enough to unstick you, a (preferably reduced) snippet of your code would help. </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div id="m_8502573363288333964divtagdefaultwrapper" dir="ltr" style="font-size:12pt;color:rgb(0,0,0);font-family:Calibri,Arial,Helvetica,sans-serif,"Apple Color Emoji","Segoe UI Emoji",NotoColorEmoji,"Segoe UI Symbol","Android Emoji",EmojiSymbols">
<p>Thank you for your time.</p>
<p><br>
</p>
<p>Best Regards,</p>
<p>Andrew<br>
</p>
<p><br>
</p>
<p><br>
</p>
</div>
<br>
<br>
Please consider the environment and think before you print. <br>
<br>
The University of the West of Scotland is a registered Scottish charity. Charity number SC002520.
<br>
<br>
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.
<br>
<br>
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.
<br>
<br>
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.
</div>

<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></blockquote></div><br></div></div>