[cfe-dev] double/virtual offsets for MSVC broken in 3.1

Don Williamson don.williamson at yahoo.com
Thu Aug 30 04:07:44 PDT 2012


The change appears to stem from:

http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/RecordLayoutBuilder.cpp?r1=143800&r2=144072&diff_format=h
Revision 144072, Modified Mon Nov 7 22:01:03 2011 CST (9 months, 3 weeks ago) by rjmccall 
Fix the layout of vb-tables and vf-tables in the MS C++ ABI. Based on work by Dmitry Sokolov!

Trying to figure out what's different...



________________________________
 From: Don Williamson <don.williamson at yahoo.com>
To: cfe-dev <cfe-dev at cs.uiuc.edu> 
Sent: Thursday, August 30, 2012 11:26 AM
Subject: [cfe-dev] double/virtual offsets for MSVC broken in 3.1
 

Hi,

last year I submitted a patch (commit by somebody else) to solve cases like this:

// The addition of a double anywhere in this struct forces the vtable ptr to occupy 4 bytes + 4 bytes padding in MSVC
struct DoubleInPolymorphicStruct
{
virtual void Empty() { }
int a;
double b;
};


The offset of a in MSVC is 8 bytes, but clang in MSVC offset calculation mode puts it at 4. The initial posts are here:

http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-September/016944.html
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2011-September/016970.html

These changes did not make it into 3.0 but as far as I could tell, did make it into the trunk. However, I've just sync'ed up to the 3.1 release and this is still a problem.

I'm about to go back and take a look and what's broken but it'll take me a couple of hours to settle back into the code again.

Meanwhile, could anybody help with any ideas as to what may have changed?

Thanks!
- Don
_______________________________________________
cfe-dev mailing list
cfe-dev at cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20120830/3cf8026a/attachment.html>


More information about the cfe-dev mailing list