Also, add a few `const` in various places.
assert(lowerBound <= upperBound);
}
- SymbolicIntegerValue GetLowerBound()
+ SymbolicIntegerValue GetLowerBound() const
{
return m_lowerBound;
}
- SymbolicIntegerValue GetUpperBound()
+ SymbolicIntegerValue GetUpperBound() const
{
return m_upperBound;
}
return (m_lowerBound <= other.m_lowerBound) && (other.m_upperBound <= m_upperBound);
}
- bool IsPositive()
+ bool IsNonNegative() const
{
return m_lowerBound >= SymbolicIntegerValue::Zero;
}
}
// TODO-Casts: extend IntegralRange to handle constants
- return IntegralRange::ForNode((GenTree*)this, comp).IsPositive();
+ return IntegralRange::ForNode(const_cast<GenTree*>(this), comp).IsNonNegative();
}
}
#endif // !FEATURE_TAILCALL_OPT
- bool NormalizesSmallTypesOnReturn()
+ bool NormalizesSmallTypesOnReturn() const
{
return GetUnmanagedCallConv() == CorInfoCallConvExtension::Managed;
}
return (gtCallMoreFlags & GTF_CALL_M_EXPANDED_EARLY) != 0;
}
- bool IsOptimizingRetBufAsLocal()
+ bool IsOptimizingRetBufAsLocal() const
{
return (gtCallMoreFlags & GTF_CALL_M_RETBUFFARG_LCLOPT) != 0;
}
return WellKnownArg::None;
}
- CFGCallKind GetCFGCallKind()
+ CFGCallKind GetCFGCallKind() const
{
#if defined(TARGET_AMD64)
// On x64 the dispatcher is more performant, but we cannot use it when
cast->SetAllEffectsFlags(src);
// Try and see if we can make this cast into a cheaper zero-extending version.
- if (genActualTypeIsInt(src) && cast->TypeIs(TYP_LONG) && srcRange.IsPositive())
+ if (genActualTypeIsInt(src) && cast->TypeIs(TYP_LONG) && srcRange.IsNonNegative())
{
cast->SetUnsigned();
}
return true;
}
- return IntegralRange::ForNode(op->AsCast()->CastOp(), this).IsPositive();
+ return IntegralRange::ForNode(op->AsCast()->CastOp(), this).IsNonNegative();
};
// If both operands have zero as the upper half then any signed/unsigned