[Chapel Merge] Improve next compiler code

Branch: refs/heads/master
Revision: 25b1846
Author: leekillough
Log Message:

Merge pull request #17648 from leekillough/index_sequence

Improve next compiler code

Add a new hash.h header file with all namespace chpl functions related to hashing.

Use C++14 std::index_sequence classes for non-recursive tuple traversal, for hashes, equal_to, and printing, among other things.

Remove empty tuple explicit specializations, since the new non- recursive code handles 0-length tuples in the same way as >0-length tuples.

Add missing system #includes for a few files (the dependencies may be currently masked by other header file includes).

Use const reference parameters for functions like operator== and std::hash on heavyweight structures which might be expensive to copy as arguments and which don't have any special move semantics which can be exploited.

Use size_t instead of int for string lengths in a few UniqueString related functions.

Inline dataAssumingTag() by moving it into its class definition.

Use brace initialization to return values of InlinedString and PodUniqueString, since they are PODs which can be initialized like p = { (const char*) s }; or even return { (const char*) s }; InlineString has an anonymous union, but it is the union's first member (const char* v) which will be initalized.

Simplify frontend::parseFile and frontend::fileLocations algorithms using std::move and std::pair.

For simple constructors/destructors/functions, move their definitions inside the class in the header file, to make them inlined and concise, such as ID, Sym and Context constructors.

For the GC code, move the initialization of currentRevisionNumber, reportError, lastPrepareToGCRevisionNumber, and gcCounter into default member initializers inside the Context class (type member = initializer;), to avoid having to list them in constructors, because they are peripheral interests. This makes the current constructor able to be = default, because the only other members of interest to Context (as of now) can be default-initialized.

Consolidate defaultReportError() and defaultReportErrorPrintDetail().

Implement Context::setErrorHandler().

Add little_endian() function to detect endianness at run-time.

[ Reviewers: @mppf ]

Modified Files:
A compiler/next/include/chpl/util/hash.h

M compiler/next/Makefile.help
M compiler/next/include/chpl/queries/Context-detail.h
M compiler/next/include/chpl/queries/Context.h
M compiler/next/include/chpl/queries/ErrorMessage.h
M compiler/next/include/chpl/queries/ID.h
M compiler/next/include/chpl/queries/Location.h
M compiler/next/include/chpl/queries/UniqueString-detail.h
M compiler/next/include/chpl/queries/UniqueString.h
M compiler/next/include/chpl/uast/ASTNode.h
M compiler/next/include/chpl/uast/ASTTypes.h
M compiler/next/include/chpl/uast/Sym.h
M compiler/next/include/chpl/util/memory.h
M compiler/next/lib/frontend/Parser/ParserContextImpl.h
M compiler/next/lib/frontend/Parser/parser-dependencies.h
M compiler/next/lib/frontend/Parser/parser-help.h
M compiler/next/lib/frontend/frontend-queries.cpp
M compiler/next/lib/queries/Context.cpp
M compiler/next/lib/queries/ID.cpp
M compiler/next/lib/queries/UniqueString.cpp
M compiler/next/lib/uast/Sym.cpp

Compare: https://github.com/chapel-lang/chapel/compare/a8c0c2b1a222...25b1846619f2