diff options
Diffstat (limited to 'mlir/lib/Target/Cpp/TranslateToCpp.cpp')
-rw-r--r-- | mlir/lib/Target/Cpp/TranslateToCpp.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/mlir/lib/Target/Cpp/TranslateToCpp.cpp b/mlir/lib/Target/Cpp/TranslateToCpp.cpp index a393d88..dcd2e11 100644 --- a/mlir/lib/Target/Cpp/TranslateToCpp.cpp +++ b/mlir/lib/Target/Cpp/TranslateToCpp.cpp @@ -17,15 +17,12 @@ #include "mlir/Support/IndentedOstream.h" #include "mlir/Support/LLVM.h" #include "mlir/Target/Cpp/CppEmitter.h" -#include "llvm/ADT/DenseMap.h" #include "llvm/ADT/ScopedHashTable.h" #include "llvm/ADT/StringExtras.h" -#include "llvm/ADT/StringMap.h" #include "llvm/ADT/TypeSwitch.h" #include "llvm/Support/Debug.h" #include "llvm/Support/FormatVariadic.h" #include <stack> -#include <utility> #define DEBUG_TYPE "translate-to-cpp" @@ -903,8 +900,7 @@ static LogicalResult printOperation(CppEmitter &emitter, emitc::ForOp forOp) { // inlined, and as such should be wrapped in parentheses in order to guarantee // its precedence and associativity. auto requiresParentheses = [&](Value value) { - auto expressionOp = - dyn_cast_if_present<ExpressionOp>(value.getDefiningOp()); + auto expressionOp = value.getDefiningOp<ExpressionOp>(); if (!expressionOp) return false; return shouldBeInlined(expressionOp); @@ -1545,7 +1541,7 @@ LogicalResult CppEmitter::emitOperand(Value value) { return success(); } - auto expressionOp = dyn_cast_if_present<ExpressionOp>(value.getDefiningOp()); + auto expressionOp = value.getDefiningOp<ExpressionOp>(); if (expressionOp && shouldBeInlined(expressionOp)) return emitExpression(expressionOp); |