Merging ChapelRangeBase.chpl into ChapelRange.chpl
Comment changes following Tom's review, plus removing two lines of useless code.
Merged chapel-lang/master
One more test adjustment, unrelated to Tom's review.
Merge pull request #90 from vasslitvinov/mergeChapelRangeBase

Merged ChapelRangeBase.chpl into ChapelRange.chpl.

[reviewed by Tom]

ChapelRangeBase.chpl was split out from ChapelRange.chpl (SVN r18549)
when ambiguous alignment was introduced, via range._aligned.

As part of the split, the fields _low, _high, _stride, _alignment,
plus a lot of the code to handle them, were moved to the record 'rangeBase'
and to the file ChapelRangeBase.chpl.
The record 'range', instead of these four fields directly, got a single
field _base that was a rangeBase.

Given our experiences with this arrangement since then, we would like
to revert it. We expect that having _base's fields directly in 'range'
would simplify the generated code. Also for a given functionality on
'range', we expect it to be easier to examine/maintain when it is
in a single function instead of being split into two.

IMPLEMENTATION STRATEGY

Primarily I inlined by hand each 'rangeBase' function into the
corresponding 'range' function. Some helper functions moved
from ChapelRangeBase.chpl to ChapelRange.chpl verbatim.

While there, I simplified some things where it looked easy enough.

-----------------------------------------------------------------------------
DETAILED NOTES

<pre>

* Simplified interior(), exterior() by merging the stridable and
  unstridable cases.

  For that, I introduced _effAlmt(), which is admittedly not very elegant.

* Fixed a bug in exterior().

* In general, paren-less member functions cannot be called without
  specifying the receiver, i.e. cannot omit the implicit "this.".
  So I made my new function paren-ful:
    _effAlmt

  and added explicit "this." for the following existing functions:
    first
    length

* Simplified this function:

    proc rangeBase.translate(i: integral)
    {
      if _isSignedType(i.type) then
        return this + i:idxType;
      else if i >= 0 then return this + i:idxType;
      else return this - abs(i):idxType;
    }

  down to the seemingly equivalent:

    return this + i:idxType;

* Merged the two separate ==(rangeBase*2) functions
  (one was for bounded ranges and the other was "else")
  into a single ==(range*2), separating them by "if isBoundedRange(r1)".

* Removed the range constructor that took rangeBase as argument,
  and a couple of other rangeBase functions that are now unused.

* In former chpl__count(), now chpl_count_help(),
  when the degenerate range is returned,
  I changed _alignment from 1 to 0 and _aligned from r._aligned with false.

  As a result, a couple of empty ranges now print without "align 1" in:

    types/range/hilde/count.chpl

* Some library and test code references range fields directly.
  I removed _base there:

    modules/dists/BlockDist.chpl
    modules/dists/dims/BlockCycDim.chpl
    test/arrays/vass/slices-with-negative-strides-1.chpl
    test/release/examples/benchmarks/miniMD/helpers/StencilDist.chpl

* Removed this test (approved by Sung):

    test/types/records/sungeun/chapelTypes/record_rangeBase.chpl

  It would break because it relies on 'rangeBase' from the modules,
  which is no longer there.

  A similiar test that uses 'range' instead of 'rangeBase',
  still exists and passes:

    (unchanged) test/types/records/sungeun/chapelTypes/record_range.chpl

* ChapelRangeBase is no longer mentioned in:

    test/modules/sungeun/init/printModuleInitOrder.good

* Tom notes that the following functions are pretty long
  and warrant refactoring:

    range.this
    chpl_count_help
    range.these (leader)
    range.these (follower)

  They were already worth refactoring prior to this change,
  and are more so now. However I am leaving refactoring as future work.

* There is one fewer instantiation of _unknown in the test
  explainInstantiation.chpl. I am assuming that it is an artifact of
  how --explain-instantiation works and not an issue with my changes:

    test/classes/hilde/explainInstantiation.good