Since a value type might be boxed and this information is missing in IR
the analysis cannot distinguish value types and boxes, so let it analyze
all for now.
This patch annotates all task properties which are not used for
UP-TO-DATE checks with Gradle's @Internal annotation (see https://
docs.gradle.org/4.0/javadoc/org/gradle/api/tasks/Internal.html) to
fix Gradle validation warnings.
Some inlined calls may require additional processing before the
inlining pass. E.g. assert() calls must be removed if assertions are
disabled by compiler flags. This patch adds an additional pass
before inlining and uses it for assertions removal.
This patch takes into account a corner case available for loops
over a progression (see backend.native/tests/external/codegen/box/
ranges/forInUntil/forInUntilMinint.kt test):
for (i in 0 until Int.MIN_VALUE) { ... }
Here we cannot use subtraction to obtain a right bound of the loop
due to an overflow. Instead we consider any loop with MIN_VALUE in
it's right bound as empty loop. Such behaviour is similar to the one
of 'until' method.
So now the empty check for a loops with 'until' call:
for (i in first until bound) { ... }
is as follows:
val last = getProgressionLast(first, bound, step) // Only if step==1
if (first <= last && bound > <Int|Long|Char>.MIN_VALUE) {
do { ... } while(i != last)
}
Further improvements: We can generate a simpler IR for some simple
frequent cases (e.g. for until calls without steps) and eliminate
loops if we can prove that they are empty.
Previously, Long.humanReadable would display byte unit suffixes as `kB`, `MB`, etc., even though the calculations on byte counts were using base 2 for calculations.
I've revised this to display sizes in the format of `kiB` or `MiB`, for kebibyte, and mebibyte - the base 2 unit equivalents of kilobyte and megabyte respectively.