Replace dyn_cast<> with isa<> when the returned value is unused (NFC)
authorMehdi Amini <aminim@google.com>
Fri, 10 May 2019 20:49:22 +0000 (13:49 -0700)
committerMehdi Amini <joker.eph@gmail.com>
Sat, 11 May 2019 02:29:18 +0000 (19:29 -0700)
    Fix a gcc warning.

--

PiperOrigin-RevId: 247669360

mlir/lib/Pass/PassTiming.cpp
mlir/tools/mlir-tblgen/RewriterGen.cpp

index 6dd55e9..b4f3756 100644 (file)
@@ -251,8 +251,7 @@ void PassTiming::runAfterPass(Pass *pass, const llvm::Any &) {
 
   // If this is an ModuleToFunctionPassAdaptorParallel, then we need to merge in
   // the timing data for the other threads.
-  if (auto *asyncMTFPass =
-          dyn_cast<ModuleToFunctionPassAdaptorParallel>(pass)) {
+  if (isa<ModuleToFunctionPassAdaptorParallel>(pass)) {
     // The asychronous pipeline timers should exist as children of root timers
     // for other threads.
     for (auto &rootTimer : llvm::make_early_inc_range(rootTimers)) {
index 6c0e528..26a8f8e 100644 (file)
@@ -281,9 +281,9 @@ void PatternEmitter::emitOpMatch(DagNode tree, int depth) {
     }
 
     // Next handle DAG leaf: operand or attribute
-    if (auto *operand = opArg.dyn_cast<NamedTypeConstraint *>()) {
+    if (opArg.is<NamedTypeConstraint *>()) {
       emitOperandMatch(tree, i, depth, indent);
-    } else if (auto *namedAttr = opArg.dyn_cast<NamedAttribute *>()) {
+    } else if (opArg.is<NamedAttribute *>()) {
       emitAttributeMatch(tree, i, depth, indent);
     } else {
       PrintFatalError(loc, "unhandled case when matching op");