diff --git a/mlir/include/mlir/Analysis/Presburger/IntegerRelation.h b/mlir/include/mlir/Analysis/Presburger/IntegerRelation.h --- a/mlir/include/mlir/Analysis/Presburger/IntegerRelation.h +++ b/mlir/include/mlir/Analysis/Presburger/IntegerRelation.h @@ -66,7 +66,7 @@ } /// Constructs a relation with the specified number of dimensions and symbols. - IntegerRelation(const PresburgerSpace &space) + explicit IntegerRelation(const PresburgerSpace &space) : IntegerRelation(/*numReservedInequalities=*/0, /*numReservedEqualities=*/0, /*numReservedCols=*/space.getNumIds() + 1, space) {} @@ -567,7 +567,7 @@ /// Constructs a relation with the specified number of dimensions and /// symbols. - IntegerPolyhedron(const PresburgerSpace &space) + explicit IntegerPolyhedron(const PresburgerSpace &space) : IntegerPolyhedron(/*numReservedInequalities=*/0, /*numReservedEqualities=*/0, /*numReservedCols=*/space.getNumIds() + 1, space) {} diff --git a/mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h b/mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h --- a/mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h +++ b/mlir/include/mlir/Analysis/Presburger/PresburgerRelation.h @@ -116,7 +116,8 @@ protected: /// Construct an empty PresburgerRelation with the specified number of /// dimension and symbols. - PresburgerRelation(const PresburgerSpace &space) : PresburgerSpace(space) { + explicit PresburgerRelation(const PresburgerSpace &space) + : PresburgerSpace(space) { assert(space.getNumLocalIds() == 0 && "PresburgerRelation cannot have local ids."); } @@ -151,7 +152,8 @@ protected: /// Construct an empty PresburgerRelation with the specified number of /// dimension and symbols. - PresburgerSet(const PresburgerSpace &space) : PresburgerRelation(space) { + explicit PresburgerSet(const PresburgerSpace &space) + : PresburgerRelation(space) { assert(space.getNumDomainIds() == 0 && "Set type cannot have domain ids."); assert(space.getNumLocalIds() == 0 && "PresburgerRelation cannot have local ids.");