Drop AffineExpr::Null

Similarly to other value-type wrappers, the default constructor of AffineExpr
    constructs a null object and removes the need for an explicit ::Null
    constructor.  Drop it and remove the only user which can trivially rely on the
    default constructor.

--

PiperOrigin-RevId: 249207502
This commit is contained in:
Alex Zinenko 2019-05-21 01:33:53 -07:00 committed by Mehdi Amini
parent 75f1a4fcc3
commit 37d0d097a9
2 changed files with 3 additions and 5 deletions

View File

@ -71,7 +71,7 @@ enum class AffineExprKind {
/// Base type for affine expression.
/// AffineExpr's are immutable value types with intuitive operators to
/// operate on chainable, lightweight compositions.
/// An AffineExpr is a POD interface to the underlying storage type pointer.
/// An AffineExpr is an interface to the underlying storage type pointer.
class AffineExpr {
public:
using ImplType = detail::AffineExprStorage;
@ -86,8 +86,6 @@ public:
return *this;
}
static AffineExpr Null() { return AffineExpr(nullptr); }
bool operator==(AffineExpr other) const { return expr == other.expr; }
bool operator!=(AffineExpr other) const { return !(*this == other); }
explicit operator bool() const { return expr; }

View File

@ -1478,7 +1478,7 @@ void FlatAffineConstraints::getSliceBounds(unsigned num, MLIRContext *context,
LLVM_DEBUG(dump());
// Record computed/detected identifiers.
SmallVector<AffineExpr, 8> memo(getNumIds(), AffineExpr::Null());
SmallVector<AffineExpr, 8> memo(getNumIds());
// Initialize dimensional and symbolic identifiers.
for (unsigned i = num, e = getNumDimIds(); i < e; i++)
memo[i] = getAffineDimExpr(i - num, context);
@ -1565,7 +1565,7 @@ void FlatAffineConstraints::getSliceBounds(unsigned num, MLIRContext *context,
// Set the lower and upper bound maps for all the identifiers that were
// computed as affine expressions of the rest as the "detected expr" and
// "detected expr + 1" respectively; set the undetected ones to Null().
// "detected expr + 1" respectively; set the undetected ones to null.
Optional<FlatAffineConstraints> tmpClone;
for (unsigned pos = 0; pos < num; pos++) {
unsigned numMapDims = getNumDimIds() - num;