[cfe-commits] r125156 - in /cfe/trunk: include/clang/AST/RecordLayout.h lib/AST/ASTContext.cpp lib/AST/RecordLayout.cpp lib/AST/RecordLayoutBuilder.cpp lib/CodeGen/CGExprConstant.cpp lib/CodeGen/CGObjCGNU.cpp lib/CodeGen/CGObjCMac.cpp lib/CodeGen
Ken Dyck
kd at kendyck.com
Thu Feb 10 04:33:15 PST 2011
On Tue, Feb 8, 2011 at 8:59 PM, Ken Dyck <kd at kendyck.com> wrote:
> Modified: cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp?rev=125156&r1=125155&r2=125156&view=diff
> ==============================================================================
> --- cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp (original)
> +++ cfe/trunk/lib/CodeGen/CGRecordLayoutBuilder.cpp Tue Feb 8 19:59:34 2011
> @@ -489,8 +490,8 @@
> }
>
> // Append tail padding.
> - if (Layout.getSize() / 8 > Size)
> - AppendPadding(Layout.getSize() / 8, Align);
> + if (Layout.getSize().getQuantity() > Size)
> + AppendPadding(Layout.getSize().getQuantity(), Align);
> }
>
> void CGRecordLayoutBuilder::LayoutBase(const CXXRecordDecl *BaseDecl,
> @@ -624,7 +625,7 @@
>
>
> // First check if we can use the same fields as for the complete class.
> - if (AlignedNonVirtualTypeSize == Layout.getSize() / 8) {
> + if (AlignedNonVirtualTypeSize == Layout.getSize().getQuantity()) {
> NonVirtualBaseTypeIsSameAsCompleteType = true;
> return true;
> }
> @@ -686,7 +687,8 @@
> }
>
> // Append tail padding if necessary.
> - AppendTailPadding(Layout.getSize());
> + AppendTailPadding(
> + Layout.getSize().getQuantity() * Types.getContext().getCharWidth());
>
> return true;
> }
These two changes introduced compile warnings because they involved
comparisons between integer types of different signedness. This has
now been corrected in r125280.
-Ken
More information about the cfe-commits
mailing list