Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/chapel-lang/chapel into dim…
Browse files Browse the repository at this point in the history
…ensionalDistToRecord
  • Loading branch information
bradcray committed Sep 15, 2023
2 parents 4240522 + 5bf2de5 commit e8e341e
Show file tree
Hide file tree
Showing 71 changed files with 3,417 additions and 875 deletions.
13 changes: 8 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -349,11 +349,14 @@ add_subdirectory(compiler)
add_subdirectory(frontend)
add_subdirectory(tools/chpldoc)

# We are not ready to include 'chpldef' in an official release just yet.
if (NOT CMAKE_BUILD_TYPE STREQUAL "Release")
if (EXISTS tools/chpldef)
add_subdirectory(tools/chpldef)
endif()
# We are not ready to include 'chpldef' in an official release just yet. This
# check works because the 'chpldef' source files are currently not included
# in source releases.
# message(STATUS "CMAKE_CURRENT_SOURCE_DIR: ${CMAKE_CURRENT_SOURCE_DIR}")
# message(STATUS "CMAKE_CURRENT_BINARY_DIR: ${CMAKE_CURRENT_BINARY_DIR}")
if (EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/tools/chpldef)
message(STATUS "Added chpldef subdirectory...")
add_subdirectory(tools/chpldef)
endif()

# Adjust the install rpath for chpl and chpldoc
Expand Down
12 changes: 5 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -111,11 +111,6 @@ third-party-chpldoc-venv: FORCE
cd third-party && $(MAKE) chpldoc-venv; \
fi

third-party-chpldef-venv: FORCE
@if [ -z "$$CHPL_DONT_BUILD_CHPLDEF_VENV" ]; then \
cd third-party && $(MAKE) chpldef-venv; \
fi

third-party-c2chapel-venv: FORCE
@if [ -z "$$CHPL_DONT_BUILD_C2CHAPEL_VENV" ]; then \
cd third-party && $(MAKE) c2chapel-venv; \
Expand All @@ -129,11 +124,14 @@ chpldoc: third-party-chpldoc-venv
@cd modules && $(MAKE)
@test -r Makefile.devel && $(MAKE) man-chpldoc || echo ""

chpldef: compiler third-party-chpldef-venv
chpldef: FORCE
@echo "Making chpldef..."
@cd third-party && $(MAKE) llvm
@cd third-party && $(MAKE) CHPL_MAKE_HOST_TARGET=--host jemalloc
cd compiler && $(MAKE) chpldef
@cd modules && $(MAKE)

chpldef-fast: FORCE
cd compiler && $(MAKE) chpldef-fast

always-build-test-venv: FORCE
-@if [ -n "$$CHPL_ALWAYS_BUILD_TEST_VENV" ]; then \
Expand Down
3 changes: 3 additions & 0 deletions Makefile.devel
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ run-frontend-linters: FORCE

run-dyno-linters: run-frontend-linters FORCE

test-chpldef: FORCE
@cd compiler && $(MAKE) test-chpldef

SPECTEST_DIR = ./test/release/examples/spec
spectests: FORCE
rm -rf $(SPECTEST_DIR)
Expand Down
15 changes: 14 additions & 1 deletion compiler/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -205,11 +205,24 @@ $(CHPLDOC): FORCE $(COMPILER_BUILD) $(MAKEALLCHPLDOCSUBDIRS) | $(CHPL_BIN_DIR)

chpldoc: FORCE $(CHPLDOC)

$(CHPLDEF): FORCE $(CHPLDEF_OBJS) | $(CHPL_BIN_DIR) $(CHPL)
MAKEALLCHPLDEFSUBDIRS = $(CHPLDEF_SUBDIRS:%=%.makedir)

$(CHPLDEF): FORCE $(COMPILER_BUILD) $(MAKEALLCHPLDEFSUBDIRS) | $(CHPL_BIN_DIR)
@cd $(COMPILER_BUILD) && $(CMAKE) $(CHPL_MAKE_HOME) $(CMAKE_FLAGS) && $(MAKE) chpldef

chpldef: FORCE $(CHPLDEF)

chpldef-fast: FORCE
@cd $(COMPILER_BUILD) && $(MAKE) chpldef

test-chpldef: FORCE $(CHPLDEF)
@echo "Making and running the chpldef tests..."
@cd $(COMPILER_BUILD) && $(CMAKE) $(CHPL_MAKE_HOME) $(CMAKE_FLAGS_NO_NDEBUG) && $(MAKE) chpldef-tests
@echo "Making symbolic link to chpldef tests in build/chpldef-test"
@cd ../build && rm -f chpldef-test && ln -s $(COMPILER_BUILD)/tools/chpldef/test chpldef-test
JOBSFLAG=`echo "$$MAKEFLAGS" | sed -n 's/.*\(-j\|--jobs=\) *\([0-9][0-9]*\).*/-j\2/p'` ; \
cd $(COMPILER_BUILD)/tools/chpldef/test && ctest $$JOBSFLAG . ;

$(COMPILER_BUILD):
mkdir -p $@

Expand Down
2 changes: 2 additions & 0 deletions frontend/include/chpl/framework/ID.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,8 @@ class ID final {
return symbolPath_.isEmpty();
}

explicit operator bool() const { return !isEmpty(); }

size_t hash() const {
(void)numChildIds_; // this field is intentionally not hashed
std::hash<int> hasher;
Expand Down
14 changes: 14 additions & 0 deletions frontend/include/chpl/framework/Location.h
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,20 @@ class Location final {
return chpl::hash(path_, firstLine_, firstColumn_, lastLine_, lastColumn_);
}

/** True if this contains 'loc' or if this and 'loc' are equal. */
bool contains(const Location& loc) {
return firstLine() <= loc.firstLine() &&
firstColumn() <= loc.firstColumn() &&
lastLine() >= loc.lastLine() &&
lastColumn() >= loc.lastColumn();
}

inline bool operator>(const Location& rhs) {
if (firstLine() > rhs.firstLine()) return true;
return firstLine() == rhs.firstLine() &&
firstColumn() > rhs.firstColumn();
}

void stringify(std::ostream& os, StringifyKind stringifyKind) const;

// TODO: We could probably save some space by using a variable byte
Expand Down
10 changes: 5 additions & 5 deletions frontend/include/chpl/framework/query-impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -565,9 +565,9 @@ Context::querySetterUpdateResult(

#if CHPL_QUERY_TIMING_AND_TRACE_ENABLED

#define QUERY_BEGIN_TIMING() \
context->queryBeginTrace(BEGIN_QUERY_FUNC_NAME, BEGIN_QUERY_ARGS); \
auto QUERY_STOPWATCH = context->makeQueryTimingStopwatch(BEGIN_QUERY_MAP)
#define QUERY_BEGIN_TIMING(context__) \
context__->queryBeginTrace(BEGIN_QUERY_FUNC_NAME, BEGIN_QUERY_ARGS); \
auto QUERY_STOPWATCH = context__->makeQueryTimingStopwatch(BEGIN_QUERY_MAP)

#else

Expand All @@ -590,7 +590,7 @@ Context::querySetterUpdateResult(
return QUERY_GET_SAVED(); \
} \
auto QUERY_RECOMPUTATION_MARKER = context->markRecomputing(false); \
QUERY_BEGIN_TIMING();
QUERY_BEGIN_TIMING(context);

/**
QUERY_BEGIN_INPUT is like QUERY_BEGIN but should be used
Expand All @@ -602,7 +602,7 @@ Context::querySetterUpdateResult(
return QUERY_GET_SAVED(); \
} \
auto QUERY_RECOMPUTATION_MARKER = context->markRecomputing(false); \
QUERY_BEGIN_TIMING();
QUERY_BEGIN_TIMING(context);

/**
Write
Expand Down
5 changes: 1 addition & 4 deletions frontend/include/chpl/parsing/FileContents.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@
#include <string>

namespace chpl {

class ErrorBase;

namespace parsing {


Expand Down Expand Up @@ -73,7 +70,7 @@ class FileContents {
std::swap(error_, other.error_);
}
static bool update(FileContents& keep, FileContents& addin) {
return defaultUpdate(keep, addin);
return chpl::defaultUpdate(keep, addin);
}
void mark(Context* context) const {
if (error_ != nullptr) error_->mark(context);
Expand Down
12 changes: 0 additions & 12 deletions modules/dists/BlockCycDist.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,6 @@ record blockCycDist: writeSerializable {

forwarding const chpl_distHelp: chpl_PrivatizedDistHelper(unmanaged BlockCyclicImpl(rank, idxType));

pragma "last resort"
@unstable("passing arguments other than 'boundingBox' and 'targetLocales' to 'blockCycDist' is currently unstable")
proc init(startIdx,
blocksize,
targetLocales: [] locale = Locales,
Expand All @@ -211,16 +209,6 @@ record blockCycDist: writeSerializable {
value);
}

proc init(boundingBox: domain,
targetLocales: [] locale = Locales)
{
this.init(boundingBox, targetLocales,
/* by specifying even one unstable argument, this should select
the whole unstable constructor, which has defaults for everything
else. */
dataParTasksPerLocale=getDataParTasksPerLocale());
}

proc init(_pid : int, _instance, _unowned : bool) {
this.rank = _instance.rank;
this.idxType = _instance.idxType;
Expand Down
6 changes: 6 additions & 0 deletions modules/internal/ChapelArray.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -2216,6 +2216,12 @@ module ChapelArray {
return try! "%?".format(x);
}

pragma "last resort"
@chpldoc.nodoc
operator :(in x: [] ?et, type t: et) where t == et {
return x;
}

pragma "fn returns aliasing array"
@chpldoc.nodoc
operator #(arr: [], counts: integral) {
Expand Down
2 changes: 0 additions & 2 deletions modules/internal/ChapelBase.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -2168,8 +2168,6 @@ module ChapelBase {
isIntegralType(t) ||
isRealType(t);

inline operator :(x:bool, type t:bool) do
return __primitive("cast", t, x);
inline operator :(x:bool, type t:integral) do
return __primitive("cast", t, x);
inline operator :(x:bool, type t:chpl_anyreal) do
Expand Down
Loading

0 comments on commit e8e341e

Please sign in to comment.