[llvm] r329045 - [TableGen] Use llvm::cast instead of static_cast so that the cast will be checked. NFC

Craig Topper via llvm-commits llvm-commits at lists.llvm.org
Mon Apr 2 22:10:12 PDT 2018


Author: ctopper
Date: Mon Apr  2 22:10:12 2018
New Revision: 329045

URL: http://llvm.org/viewvc/llvm-project?rev=329045&view=rev
Log:
[TableGen] Use llvm::cast instead of static_cast so that the cast will be checked. NFC

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

Modified: llvm/trunk/utils/TableGen/X86RecognizableInstr.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/utils/TableGen/X86RecognizableInstr.cpp?rev=329045&r1=329044&r2=329045&view=diff
==============================================================================
--- llvm/trunk/utils/TableGen/X86RecognizableInstr.cpp (original)
+++ llvm/trunk/utils/TableGen/X86RecognizableInstr.cpp Mon Apr  2 22:10:12 2018
@@ -40,7 +40,7 @@ static uint8_t byteFromBitsInit(BitsInit
   uint8_t ret = 0;
 
   for (index = 0; index < width; index++) {
-    if (static_cast<BitInit*>(init.getBit(index))->getValue())
+    if (cast<BitInit>(init.getBit(index))->getValue())
       ret |= mask;
 
     mask <<= 1;




More information about the llvm-commits mailing list