[cfe-commits] r82736 - in /cfe/trunk: lib/AST/RecordLayoutBuilder.cpp lib/AST/RecordLayoutBuilder.h test/SemaCXX/empty-class-layout.cpp

Daniel Dunbar daniel at zuster.org
Sat Sep 26 09:36:45 PDT 2009


On Thu, Sep 24, 2009 at 5:02 PM, Anders Carlsson <andersca at mac.com> wrote:
>  void ASTRecordLayoutBuilder::UpdateEmptyClassOffsets(const CXXRecordDecl *RD,
>                                                      uint64_t Offset) {
>   if (RD->isEmpty())
> @@ -485,6 +497,17 @@
>
>     // Round up the current record size to the field's alignment boundary.
>     FieldOffset = llvm::RoundUpToAlignment(FieldOffset, FieldAlign);
> +
> +    if (!IsUnion) {

'if (IsUnion) return;'?

> +      while (true) {
> +        // Check if we can place the field at this offset.
> +        if (canPlaceFieldAtOffset(D, FieldOffset))
> +          break;
> +
> +        // We can't try again.

This comment is wrong?

> +        FieldOffset += FieldAlign;
> +      }
> +    }
>   }
>
>   // Place this field at the current location.
>

 - Daniel




More information about the cfe-commits mailing list