I am creating my own mangler instance. The problem is that it takes an AST context, which has it's own CXXABI object, and it can't be changed.<div><br></div><div>And you are right, it's probably not correct under all the circumstances, I'll change my code to make an AST for each different ABI. I had not remembered about template parameters, that is a good reason.</div>

<div><br></div><div>By the way, is there any reason ABI dependent stuff could not be abstracted from the actual AST? It just feels wasteful to have to parse code twice to get layout and mangling information.</div><div><br>

<div class="gmail_quote">On Sun, Aug 19, 2012 at 10:41 PM, John McCall <span dir="ltr"><<a href="mailto:rjmccall@apple.com" target="_blank">rjmccall@apple.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

<div class="im">On Aug 19, 2012, at 2:55 AM, Joćo Matos wrote:<br>
> Well, my use case is for doing name mangling correctly with the MS and Itanium manglers.<br>
<br>
</div>You want to take an existing AST and apply both MS and Itanium manglings to it,<br>
regardless of which ABI it was parsed under?  I think the correct approach is to<br>
explicitly create your own mangler instance, rather than relying on the information<br>
from the ASTContext to make one.<br>
<br>
Whether this is actually sensible depends on what you're really trying to do.<br>
Sean's point that the ABI can substantially affect the AST isn't just notional —<br>
most of the time, things like sizes aren't mangled, but if they're used as a<br>
template argument they certainly will be.<br>
<span class="HOEnZb"><font color="#888888"><br>
John.</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br>Joćo Matos<br>
</div>