Skip to content
This repository was archived by the owner on Oct 12, 2022. It is now read-only.

Commit 27834ed

Browse files
committed
Merge remote-tracking branch 'upstream/master' into stable
2 parents b87d7df + 48dea88 commit 27834ed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1310
-747
lines changed

.cirrus.yml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -20,20 +20,20 @@ common_steps_template: &COMMON_STEPS_TEMPLATE
2020
DMD_BRANCH="master"
2121
fi
2222
git clone --branch "$DMD_BRANCH" --depth 1 https://github.com/dlang/dmd.git ../dmd
23-
install_prerequisites_script: cd ../dmd && ./cirrusci.sh
24-
install_host_compiler_script: cd ../dmd && ./ci.sh install_host_compiler
23+
install_prerequisites_script: cd ../dmd && ./ci/cirrusci.sh
24+
install_host_compiler_script: cd ../dmd && ./ci/run.sh install_host_compiler
2525
setup_repos_script: |
2626
set -uexo pipefail
2727
ln -s $CIRRUS_WORKING_DIR ../druntime
28-
cd ../dmd && ./ci.sh setup_repos "$REPO_BRANCH"
29-
build_script: cd ../dmd && ./ci.sh build
30-
test_dmd_script: cd ../dmd && ./ci.sh test_dmd
31-
test_druntime_script: cd ../dmd && ./ci.sh test_druntime
32-
test_phobos_script: cd ../dmd && ./ci.sh test_phobos
28+
cd ../dmd && ./ci/run.sh setup_repos "$REPO_BRANCH"
29+
build_script: cd ../dmd && ./ci/run.sh build
30+
test_dmd_script: cd ../dmd && ./ci/run.sh test_dmd
31+
test_druntime_script: cd ../dmd && ./ci/run.sh test_druntime
32+
test_phobos_script: cd ../dmd && ./ci/run.sh test_phobos
3333

3434
environment:
3535
CIRRUS_CLONE_DEPTH: 1
36-
# for ci.sh:
36+
# for ci/run.sh:
3737
MODEL: 64
3838
HOST_DMD: dmd
3939
N: 4
@@ -53,7 +53,7 @@ task:
5353
- TASK_NAME_SUFFIX: x86
5454
MODEL: 32
5555
- TASK_NAME_SUFFIX: x64
56-
install_git_script: apt-get -q update && apt-get install -yq git-core
56+
install_git_and_valgrind_script: apt-get -q update && apt-get install -yq git-core valgrind
5757
<< : *COMMON_STEPS_TEMPLATE
5858

5959
# Mac

mak/COPY

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ COPY=\
1515
$(IMPDIR)\core\cpuid.d \
1616
$(IMPDIR)\core\demangle.d \
1717
$(IMPDIR)\core\exception.d \
18+
$(IMPDIR)\core\int128.d \
1819
$(IMPDIR)\core\lifetime.d \
1920
$(IMPDIR)\core\math.d \
2021
$(IMPDIR)\core\memory.d \

src/core/atomic.d

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ template cas(MemoryOrder succ = MemoryOrder.seq, MemoryOrder fail = MemoryOrder.
292292
in (atomicPtrIsProperlyAligned(here), "Argument `here` is not properly aligned")
293293
{
294294
// resolve implicit conversions
295-
T arg1 = ifThis;
295+
const T arg1 = ifThis;
296296
T arg2 = writeThis;
297297

298298
static if (__traits(isFloating, T))
@@ -1276,4 +1276,13 @@ version (CoreUnittest)
12761276
shared NoIndirections n;
12771277
static assert(is(typeof(atomicLoad(n)) == NoIndirections));
12781278
}
1279+
1280+
unittest // Issue 21631
1281+
{
1282+
shared uint si1 = 45;
1283+
shared uint si2 = 38;
1284+
shared uint* psi = &si1;
1285+
1286+
assert((&psi).cas(cast(const) psi, &si2));
1287+
}
12791288
}

src/core/bitop.d

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -758,19 +758,6 @@ version (DigitalMars) version (AnyX86)
758758
}
759759

760760

761-
// @@@DEPRECATED_2.099@@@
762-
deprecated("volatileLoad has been moved to core.volatile. Use core.volatile.volatileLoad instead.")
763-
{
764-
public import core.volatile : volatileLoad;
765-
}
766-
767-
// @@@DEPRECATED_2.099@@@
768-
deprecated("volatileStore has been moved to core.volatile. Use core.volatile.volatileStore instead.")
769-
{
770-
public import core.volatile : volatileStore;
771-
}
772-
773-
774761
/**
775762
* Reverses the order of bits in a 32-bit integer.
776763
*/

src/core/demangle.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1339,7 +1339,7 @@ pure @safe:
13391339
TypeFunction:
13401340
CallConvention FuncAttrs Arguments ArgClose Type
13411341
*/
1342-
char[] parseTypeFunction( char[] name = null, IsDelegate isdg = IsDelegate.no ) return
1342+
char[] parseTypeFunction( char[] name = null, IsDelegate isdg = IsDelegate.no ) return scope
13431343
{
13441344
debug(trace) printf( "parseTypeFunction+\n" );
13451345
debug(trace) scope(success) printf( "parseTypeFunction-\n" );

src/core/exception.d

Lines changed: 42 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -19,29 +19,6 @@ void __switch_errorT()(string file = __FILE__, size_t line = __LINE__) @trusted
1919
assert(0, "No appropriate switch clause found");
2020
}
2121

22-
version (D_BetterC)
23-
{
24-
// When compiling with -betterC we use template functions so if they are
25-
// used the bodies are copied into the user's program so there is no need
26-
// for the D runtime during linking.
27-
28-
// In the future we might want to convert all functions in this module to
29-
// templates even for ordinary builds instead of providing them as an
30-
// extern(C) library.
31-
32-
void onOutOfMemoryError()(void* pretend_sideffect = null) @nogc nothrow pure @trusted
33-
{
34-
assert(0, "Memory allocation failed");
35-
}
36-
alias onOutOfMemoryErrorNoGC = onOutOfMemoryError;
37-
38-
void onInvalidMemoryOperationError()(void* pretend_sideffect = null) @nogc nothrow pure @trusted
39-
{
40-
assert(0, "Invalid memory operation");
41-
}
42-
}
43-
else:
44-
4522
/**
4623
* Thrown on a range error.
4724
*/
@@ -218,17 +195,17 @@ private void rangeMsgPut(ref char[] r, scope const(char)[] e) @nogc nothrow pure
218195
*/
219196
class AssertError : Error
220197
{
221-
@safe pure nothrow this( string file, size_t line )
198+
@safe pure nothrow @nogc this( string file, size_t line )
222199
{
223200
this(cast(Throwable)null, file, line);
224201
}
225202

226-
@safe pure nothrow this( Throwable next, string file = __FILE__, size_t line = __LINE__ )
203+
@safe pure nothrow @nogc this( Throwable next, string file = __FILE__, size_t line = __LINE__ )
227204
{
228205
this( "Assertion failure", file, line, next);
229206
}
230207

231-
@safe pure nothrow this( string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null )
208+
@safe pure nothrow @nogc this( string msg, string file = __FILE__, size_t line = __LINE__, Throwable next = null )
232209
{
233210
super( msg, file, line, next );
234211
}
@@ -692,26 +669,49 @@ extern (C) void onFinalizeError( TypeInfo info, Throwable e, string file = __FIL
692669
throw staticError!FinalizeError(info, e, file, line);
693670
}
694671

695-
/**
696-
* A callback for out of memory errors in D. An $(LREF OutOfMemoryError) will be
697-
* thrown.
698-
*
699-
* Throws:
700-
* $(LREF OutOfMemoryError).
701-
*/
702-
extern (C) void onOutOfMemoryError(void* pretend_sideffect = null) @trusted pure nothrow @nogc /* dmd @@@BUG11461@@@ */
672+
version (D_BetterC)
703673
{
704-
// NOTE: Since an out of memory condition exists, no allocation must occur
705-
// while generating this object.
706-
throw staticError!OutOfMemoryError();
707-
}
674+
// When compiling with -betterC we use template functions so if they are
675+
// used the bodies are copied into the user's program so there is no need
676+
// for the D runtime during linking.
708677

709-
extern (C) void onOutOfMemoryErrorNoGC() @trusted nothrow @nogc
710-
{
711-
// suppress stacktrace until they are @nogc
712-
throw staticError!OutOfMemoryError(false);
678+
// In the future we might want to convert all functions in this module to
679+
// templates even for ordinary builds instead of providing them as an
680+
// extern(C) library.
681+
682+
void onOutOfMemoryError()(void* pretend_sideffect = null) @nogc nothrow pure @trusted
683+
{
684+
assert(0, "Memory allocation failed");
685+
}
686+
alias onOutOfMemoryErrorNoGC = onOutOfMemoryError;
687+
688+
void onInvalidMemoryOperationError()(void* pretend_sideffect = null) @nogc nothrow pure @trusted
689+
{
690+
assert(0, "Invalid memory operation");
691+
}
713692
}
693+
else
694+
{
695+
/**
696+
* A callback for out of memory errors in D. An $(LREF OutOfMemoryError) will be
697+
* thrown.
698+
*
699+
* Throws:
700+
* $(LREF OutOfMemoryError).
701+
*/
702+
extern (C) void onOutOfMemoryError(void* pretend_sideffect = null) @trusted pure nothrow @nogc /* dmd @@@BUG11461@@@ */
703+
{
704+
// NOTE: Since an out of memory condition exists, no allocation must occur
705+
// while generating this object.
706+
throw staticError!OutOfMemoryError();
707+
}
714708

709+
extern (C) void onOutOfMemoryErrorNoGC() @trusted nothrow @nogc
710+
{
711+
// suppress stacktrace until they are @nogc
712+
throw staticError!OutOfMemoryError(false);
713+
}
714+
}
715715

716716
/**
717717
* A callback for invalid memory operations in D. An

src/core/gc/gcinterface.d

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,13 +141,13 @@ interface GC
141141
* Retrieve statistics about garbage collection.
142142
* Useful for debugging and tuning.
143143
*/
144-
core.memory.GC.Stats stats() nothrow;
144+
core.memory.GC.Stats stats() @safe nothrow @nogc;
145145

146146
/**
147147
* Retrieve profile statistics about garbage collection.
148148
* Useful for debugging and tuning.
149149
*/
150-
core.memory.GC.ProfileStats profileStats() nothrow @safe;
150+
core.memory.GC.ProfileStats profileStats() @safe nothrow @nogc;
151151

152152
/**
153153
* add p to list of roots

0 commit comments

Comments
 (0)