[cfe-commits] r77087 - in /cfe/trunk: lib/AST/RecordLayoutBuilder.cpp lib/CodeGen/CGCXX.cpp lib/CodeGen/CodeGenTypes.cpp test/CodeGenCXX/constructor-init.cpp
andersca at mac.com
Tue Jul 28 09:44:18 PDT 2009
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
> ir-gen for non-virtual base class initialization
> in constructors.
> 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
> 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.
More information about the cfe-commits