diff --git a/mlir/include/mlir/EDSC/Builders.h b/mlir/include/mlir/EDSC/Builders.h --- a/mlir/include/mlir/EDSC/Builders.h +++ b/mlir/include/mlir/EDSC/Builders.h @@ -303,7 +303,7 @@ "MemRef, RankedTensor or Vector expected"); } - bool hasValue() const { return value; } + bool hasValue() const { return (bool)value; } Value getValue() const { assert(value && "StructuredIndexed Value not set."); return value; diff --git a/mlir/include/mlir/IR/Value.h b/mlir/include/mlir/IR/Value.h --- a/mlir/include/mlir/IR/Value.h +++ b/mlir/include/mlir/IR/Value.h @@ -92,7 +92,7 @@ return U(ownerAndKind); } - operator bool() const { return ownerAndKind.getPointer(); } + explicit operator bool() const { return ownerAndKind.getPointer(); } bool operator==(const Value &other) const { return ownerAndKind == other.ownerAndKind; } diff --git a/mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp b/mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp --- a/mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp +++ b/mlir/lib/Conversion/VectorToSCF/VectorToSCF.cpp @@ -281,7 +281,8 @@ } }); - assert((!options.unroll ^ result) && "Expected resulting Value iff unroll"); + assert((!options.unroll ^ (bool)result) && + "Expected resulting Value iff unroll"); if (!result) result = std_load(vector_type_cast(MemRefType::get({}, vectorType), alloc)); rewriter.replaceOp(op, result); diff --git a/mlir/lib/Parser/Parser.cpp b/mlir/lib/Parser/Parser.cpp --- a/mlir/lib/Parser/Parser.cpp +++ b/mlir/lib/Parser/Parser.cpp @@ -3542,14 +3542,14 @@ // Check for any forward references that are left. If we find any, error // out. if (!forwardRefPlaceholders.empty()) { - SmallVector, 4> errors; + SmallVector errors; // Iteration over the map isn't deterministic, so sort by source location. for (auto entry : forwardRefPlaceholders) - errors.push_back({entry.second.getPointer(), entry.first}); + errors.push_back(entry.second.getPointer()); llvm::array_pod_sort(errors.begin(), errors.end()); for (auto entry : errors) { - auto loc = SMLoc::getFromPointer(entry.first); + auto loc = SMLoc::getFromPointer(entry); emitError(loc, "use of undeclared SSA value name"); } return failure();