[cfe-dev] Clang/LLVM Member Function Pointers size and behavior?

John McCall rjmccall at apple.com
Tue Oct 16 11:53:39 PDT 2012


On Oct 16, 2012, at 11:26 AM, Devid wrote:
>> I'm confused.  You need compatibility with MSVC about the size of member
>> function pointers, but you don't care about compatibility of, say, class
>> layout
>> or vtables or anything like that? 
> 
> Well it would be great that this will be compatible too but for now member
> function pointers compatibility is probably enough.
> For example I just do not use virtual functions for now.

If you're not using virtual functions, manglings will matter, and the
Itanium manglings are totally different from the MSVC manglings.
So I really doubt that you're actually going to get any real sort of
compatibility without turning on the MSVC compatibility stuff.

(I'm not actually certain how to do that at the driver level, because I
mostly just code-review this work rather than take advantage of it.
But other people on the list should be able to help, or you can check
the archives to find where it's been discussed before.)

The good news is that, if you're not using virtual functions or bases,
there aren't any known, major problems (besides member pointers)
that you're going to run into.

>> You'll have to also hack code generation so that 
> Any tips where to start doing this ?

The right thing to do is to go to MicrosoftCXXABI.cpp and start adding
real implementations of the various member-pointer APIs.

>> These are just private changes and you're not hoping to upstream them,
>> right?
> This is dependent. If I will be able to find proper solution then upstream
> them would be great.
> But for now it appears for me like a Ugly Hack that nobody really need,
> except of me.

Yeah, we definitely would not accept anything modifying the Itanium ABI
code.  The right solution is to continue to flesh out the dedicated Microsoft
ABI support.

John.



More information about the cfe-dev mailing list