]> granicus.if.org Git - clang/commitdiff
Use Context.getCharWidth() in place of literal '8's in assertions.
authorKen Dyck <kd@kendyck.com>
Thu, 24 Feb 2011 01:33:05 +0000 (01:33 +0000)
committerKen Dyck <kd@kendyck.com>
Thu, 24 Feb 2011 01:33:05 +0000 (01:33 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@126356 91177308-0d34-0410-b5e6-96231b3b80d8

lib/AST/RecordLayoutBuilder.cpp

index 76cc5e201188a91754228969164674524f99a27f..4ed031f974998b88fc1aefd9b87860a59f7f9b5c 100644 (file)
@@ -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; }