[cfe-commits] [patch] CXXABI getter/setter

Sean Silva silvas at purdue.edu
Sun Aug 19 10:43:36 PDT 2012


> They take an ASTContext and get the existing CXXABI object to ask it some
> details like the default calling conventions for methods, so if the correct
> ABI object is not changed the mangled names will be incorrect. And parsing
> the code twice to get a different ASTContext with another ABI doesn't seem
> like a good idea.

But things like record layout depend on the ABI, and hence the AST is
not a valid AST under the different ABI. That difference alone means
that it is possible for compilation to succeed under one ABI yet fail
under another.

I think that a re-parse is the only correct solution.

--Sean Silva

On Sun, Aug 19, 2012 at 3:55 AM, João Matos <ripzonetriton at gmail.com> wrote:
> Well, my use case is for doing name mangling correctly with the MS and
> Itanium manglers.
>
> They take an ASTContext and get the existing CXXABI object to ask it some
> details like the default calling conventions for methods, so if the correct
> ABI object is not changed the mangled names will be incorrect. And parsing
> the code twice to get a different ASTContext with another ABI doesn't seem
> like a good idea.
>
> Or maybe this can be refactored to extract the CXXABI out of the ASTContext,
> and inject it by external logic where it's needed.
>
> On Sun, Aug 19, 2012 at 2:52 AM, Sean Silva <silvas at purdue.edu> wrote:
>>
>> What are the invariants on the setter? Is there even a time when it is
>> makes sense to switch out the ABI member? If so, please clearly
>> document when it makes sense to do so.
>>
>> --Sean Silva
>>
>> On Sat, Aug 18, 2012 at 10:02 AM, João Matos <ripzonetriton at gmail.com>
>> wrote:
>> > Attached is a patch that provides a way to get / set the active C++ ABI
>> > object on the AST context.
>> >
>> > --
>> > João Matos
>> >
>> > _______________________________________________
>> > cfe-commits mailing list
>> > cfe-commits at cs.uiuc.edu
>> > http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>> >
>
>
>
>
> --
> João Matos




More information about the cfe-commits mailing list