[Mlir-commits] [mlir] ad315eb - [MLIR][NFC]Fix unusued variable warning. (#97813)

llvmlistbot at llvm.org llvmlistbot at llvm.org
Tue Jul 9 02:35:09 PDT 2024


Author: Mats Petersson
Date: 2024-07-09T10:35:06+01:00
New Revision: ad315ebfee626dbd472b9d68a76632f9e68bc8f5

URL: https://github.com/llvm/llvm-project/commit/ad315ebfee626dbd472b9d68a76632f9e68bc8f5
DIFF: https://github.com/llvm/llvm-project/commit/ad315ebfee626dbd472b9d68a76632f9e68bc8f5.diff

LOG: [MLIR][NFC]Fix unusued variable warning. (#97813)

This just changes a dyn_cast to and isa call to check for type, which
avoids getting a warning in clang. The variable `ity` is not used in the
next block.

No functional change.

Added: 
    

Modified: 
    mlir/lib/Target/LLVMIR/ModuleTranslation.cpp

Removed: 
    


################################################################################
diff  --git a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
index bc0f709fc22c9..1d2e4725d5d63 100644
--- a/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
+++ b/mlir/lib/Target/LLVMIR/ModuleTranslation.cpp
@@ -639,8 +639,7 @@ llvm::Constant *mlir::LLVM::detail::getLLVMConstant(
         if (llvm::ConstantDataSequential::isElementTypeCompatible(
                 elementType)) {
           // TODO: Handle all compatible types. This code only handles integer.
-          if (llvm::IntegerType *iTy =
-                  dyn_cast<llvm::IntegerType>(elementType)) {
+          if (isa<llvm::IntegerType>(elementType)) {
             if (llvm::ConstantInt *ci = dyn_cast<llvm::ConstantInt>(child)) {
               if (ci->getBitWidth() == 8) {
                 SmallVector<int8_t> constants(numElements, ci->getZExtValue());


        


More information about the Mlir-commits mailing list