[llvm] r304100 - [TableGen][X86] Use CHAR_BIT with sizeof instead of hardcoded 8. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Sun May 28 11:24:44 PDT 2017


Author: ctopper
Date: Sun May 28 13:24:43 2017
New Revision: 304100

URL: http://llvm.org/viewvc/llvm-project?rev=304100&view=rev
Log:
[TableGen][X86] Use CHAR_BIT with sizeof instead of hardcoded 8. NFC

Modified:
    llvm/trunk/utils/TableGen/X86FoldTablesEmitter.cpp

Modified: llvm/trunk/utils/TableGen/X86FoldTablesEmitter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/X86FoldTablesEmitter.cpp?rev=304100&r1=304099&r2=304100&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/X86FoldTablesEmitter.cpp (original)
+++ llvm/trunk/utils/TableGen/X86FoldTablesEmitter.cpp Sun May 28 13:24:43 2017
@@ -241,7 +241,8 @@ static bool hasPtrTailcallRegClass(const
 
 // Calculates the integer value representing the BitsInit object
 static inline uint64_t getValueFromBitsInit(const BitsInit *B) {
-  assert(B->getNumBits() <= sizeof(uint64_t) * 8 && "BitInits' too long!");
+  assert(B->getNumBits() <= sizeof(uint64_t) * CHAR_BIT &&
+         "BitInits' too long!");
 
   uint64_t Value = 0;
   for (unsigned i = 0, e = B->getNumBits(); i != e; ++i) {




More information about the llvm-commits mailing list