On Jul 25, 2009, at 2:12 PM, Fariborz Jahanian wrote: > Author: fjahanian > Date: Sat Jul 25 16:12:28 2009 > New Revision: 77087 > > URL: http://llvm.org/viewvc/llvm-project?rev=77087&view=rev > Log: > ir-gen for non-virtual base class initialization > in constructors. >
Cool. > Added: > cfe/trunk/test/CodeGenCXX/constructor-init.cpp > Modified: > cfe/trunk/lib/AST/RecordLayoutBuilder.cpp > cfe/trunk/lib/CodeGen/CGCXX.cpp > cfe/trunk/lib/CodeGen/CodeGenTypes.cpp > > Modified: cfe/trunk/lib/AST/RecordLayoutBuilder.cpp > URL: > http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/RecordLayoutBuilder.cpp?rev=77087&r1=77086&r2=77087&view=diff > > = > = > = > = > = > = > = > = > ====================================================================== > --- cfe/trunk/lib/AST/RecordLayoutBuilder.cpp (original) > +++ cfe/trunk/lib/AST/RecordLayoutBuilder.cpp Sat Jul 25 16:12:28 2009 > @@ -53,6 +53,9 @@ > // Round up the current record size to the base's alignment > boundary. > Size = (Size + (BaseAlign-1)) & ~(BaseAlign-1); > > + // Non-virtual base class has offset too. > + FieldOffsets.push_back(Size); > + I intentionally did not emit field offsets for base classes because: 1. They're somewhat different from regular fields 2. This makes the FieldOffsets mean something different in C++ vs C. I have a patch that implements type layout for non-virtual base classes and I plan to land it later today. Anders _______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
