Fixed .good and removed .future for test of forall array declaration
syntax of a field in a class.  This test was probably fixed with
r14311 6 days after it was checked in.


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@14445 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
More cleanup to wrapper code:

  - Reordered wrapper code according to wrapper type.

  - Removed code to make method calls partial (two calls) as this is
    no longer necessary.

  - Factored out code to insert wrapped call into wrapper since this
    is the same for all but the promotion wrapper.

  - Inserted code to set the currentLineno when building the wrapper
    so that the line numbers don't need to be fixed or cleared later.
    Removed clear_line_info function as it is no longer used.


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@14446 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Added SET_LINENO macro to set the line number that new AST nodes will
take on; so SET_LINENO(ast) sets the line number for all new ASTs to
the line number of the ast passed to this macro.  It uses the global
variable currentLineno and doesn't change anything semantically.

Removed duplicated code in compiler in function that builds chpl_main.
Also improved the error message for multiple modules without main to
mention the --main-module flag.


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@14447 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Minor simplifications of coercion wrapper code

Also factored out the setting of wrapper->isCompilerTemp to true so
that it is done for all wrappers except the default wrapper for a
constructor; this makes sense because the default wrapper for a
constructor is more of a specialized constructor.  Setting the
isCompilerTemp flag for wrappers improves error message reporting
since a call site of the wrapper is used for function resolution
errors.


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@14448 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Simplified and optimized normalize:

  - Removed Symbol::defSetGet which was used but unnecessary.

  - Moved some functionality in the normalize variant called from
    multiple places into the normalize pass variant, including the
    code to fixup array and query formals, handle nested constructor
    calls, clone parameterized primitive methods, and check config
    params.

  - Fused calls to collect_asts to decrease the number of times that
    the IR is traversed on any given call to normalize.

  - Removed redundant collections and removed some guard cases from
    the code to fixup DefExprs.


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@14449 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Make range slicing work near type boundaries

The code to snap the low and high range bounds in place after slicing it with
another range would overflow when working near min(eltType). The overflow was
happening in the code: var d = abs(alignment - low) % s; where alignment and
low are both of generic type eltType, and s is a positive int cast to eltType.

Since s is positive, this overflow can be avoided by pushing the modulus in
before the subtraction using a few tricks.

For negative a, the a % b operation doesn't return a number that is congruent
to a (mod b), so I wrote a mod(a,b) function that returns the value in [0, b-1]
that is congruent to a (mod b). This could maybe go into the Math module.

First, note that if a > b then abs(a - b) is a - b, otherwise it is b - a. So,
replace the abs() call with this if then else expression.

Next, if a1 is congruent to a2 (mod s) and b1 is congruent to b2 (mod s) then
a1 - b1 is congruent to a2 - b2 (mod s). Use the mod function defined above to
create suitable a2 and b2, and subtract these (mod s) instead.

Finally, with the uint types, the a2 - b2 subtraction could still result in an
overflow. This can be avoided by seeing that they are both in [0, s-1] and s
is a positive int, so a2 and b2 can safely be cast to int before doing the
subtraction.

Remove my .future about this. Also, fix the .good for my Cyclic distribution
test. It was expecting to be one element smaller than it should have been
because of these overflow problems.


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@14450 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Refactored instantiation code:

  - Removed unnecessary instantiatedWith vector.

  - Moved copy of FnSymbol::isExtern into FnSymbol (already in VarSymbol).

  - Moved evaluation of where clause into its own function and pushed
    it before putting the function in the cache.  This removes many
    multiple evaluations of a function's where clause (though by the
    time it used to be evaluated a second time, it was very fast
    because it would simply be true or false).

  - Minor cleanup and simplifications as well.


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@14451 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Factored out the common part of the grammar rules for destructors

This simplifies the rules for fn_decl_stmt_inner, and adds a rule to
fn_identifier that allows for the ~ in front of destructors.


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@14452 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Updating week's worth of REGRESSIONS

Summary:
- overall, opts runs got better (appeared worse due to tensor regressions)
- one new GASNet regression: test_promote_inout



git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@14453 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Oops, forgot to remove tensor from REGRESSIONS

Somehow missed it was fixed even though I knew it was supposed to be...



git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@14454 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
More refactoring of instantiation code + fixed valgrind regression.


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@14455 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Removed BradsBlock1DPar workaround

Removed workaround to what I'd been doing in the
constructor of the global distribution class,
thanks to Steve's fix of this past week.




git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@14456 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Avoid the need to update an instantiated constructor in a separate loop from
the copy by adding a mapping from the old return type to the new return type to
the map used to copy the constructor in the first place.


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@14457 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Capture range by and # ideas in a test

This test lists my expected behavior for various combinations of ranges using
by and # from recent email. It also includes a potential implementation of by
and # in a module.


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@14458 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Add some more range bound type overflow issue tests

These tests cause integer overflows in four different places within ChapelRange resulting
in incorrect results.

The tests testRangeLength and testRangeSlice2 have simple fixes.

The tests testRangeSlice and testRangeSlice3 cause overflows in two places on the same
line and do not seem to have simple fixes.


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@14459 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
removed support for --nostdincs and related test


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@14460 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Add a test that overloads the by operator

Should overloading by for argument pairs other than (range,int) be allowed?
It currently is, but is not included in the list of operators that can be
overloaded in section 13.9 of the spec.


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@14461 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Optimized visible function lookup in function resolution so that all
functions defined top-level in any standard module are grouped
together.  Since these modules all mutually use one another, when
looking up a visible function in such a scope, all of the functions
are always found anyway.  This optimization improves the performance
of visible function lookup by about 75% and impacts total performance
to an extent.


git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@14462 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Updating REGRESSIONS based on weekend runs...

Just a few small fluctuations in the opts testing...




git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@14463 3a8e244f-b0f2-452b-bcba-4c88e055c3ca
Renamed Vector module to Containers.  I get some issues when the module name
is the same as the class.  Also added a couple test cases for Vector.



git-svn-id: http://svn.code.sf.net/p/chapel/code/trunk@14464 3a8e244f-b0f2-452b-bcba-4c88e055c3ca