From: Ken Dyck Date: Thu, 24 Feb 2011 01:33:05 +0000 (+0000) Subject: Use Context.getCharWidth() in place of literal '8's in assertions. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9911344114cc493e089964f7602b619e5a47c7bc;p=clang Use Context.getCharWidth() in place of literal '8's in assertions. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126356 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/AST/RecordLayoutBuilder.cpp b/lib/AST/RecordLayoutBuilder.cpp index 76cc5e2011..4ed031f974 100644 --- a/lib/AST/RecordLayoutBuilder.cpp +++ b/lib/AST/RecordLayoutBuilder.cpp @@ -699,7 +699,7 @@ protected: DiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID); CharUnits getSize() const { - assert(Size % 8 == 0); + assert(Size % Context.getCharWidth() == 0); return Context.toCharUnitsFromBits(Size); } uint64_t getSizeInBits() const { return Size; } @@ -708,7 +708,7 @@ protected: void setSize(uint64_t NewSize) { Size = NewSize; } CharUnits getDataSize() const { - assert(DataSize % 8 == 0); + assert(DataSize % Context.getCharWidth() == 0); return Context.toCharUnitsFromBits(DataSize); } uint64_t getDataSizeInBits() const { return DataSize; }