summaryrefslogtreecommitdiff
path: root/libphobos/libdruntime
diff options
context:
space:
mode:
authorIain Buclaw <ibuclaw@gdcproject.org>2024-02-17 21:03:38 +0100
committerIain Buclaw <ibuclaw@gdcproject.org>2024-02-17 21:28:58 +0100
commit5aff58e5ed8f634e0b20892452bde484db93039b (patch)
tree64900b511f0dbee5f61fb9e3e19c1ee8274f166a /libphobos/libdruntime
parenta71d87431d0c4e04a402ef6566be090c470b2b53 (diff)
d: Merge dmd, druntime 9471b25db9, phobos 547886846.
D front-end changes: - Import dmd v2.107.1-rc.1. D runtime changes: - Import druntime v2.107.1-rc.1. Phobos changes: - Import phobos v2.107.1-rc.1. gcc/d/ChangeLog: * dmd/MERGE: Merge upstream dmd 9471b25db9. * dmd/VERSION: Bump version to v2.107.1-rc.1. * Make-lang.in (D_FRONTEND_OBJS): Add d/cxxfrontend.o. * d-attribs.cc (build_attributes): Update for new front-end interface. * d-builtins.cc (build_frontend_type): Likewise. (strip_type_modifiers): Likewise. (covariant_with_builtin_type_p): Likewise. * d-codegen.cc (declaration_type): Likewise. (parameter_type): Likewise. (build_array_struct_comparison): Likewise. (void_okay_p): Likewise. * d-convert.cc (convert_expr): Likewise. (check_valist_conversion): Likewise. * d-lang.cc (d_generate_ddoc_file): Likewise. (d_parse_file): Likewise. * d-target.cc (TargetCPP::toMangle): Likewise. (TargetCPP::typeInfoMangle): Likewise. (TargetCPP::thunkMangle): Likewise. (TargetCPP::parameterType): Likewise. * decl.cc (d_mangle_decl): Likewise. (DeclVisitor::visit): Likewise. (DeclVisitor::visit (CAsmDeclaration *)): New method. (get_symbol_decl): Update for new front-end interface. (layout_class_initializer): Likewise. * expr.cc (ExprVisitor::visit): Likewise. * intrinsics.cc (maybe_set_intrinsic): Likewise. (expand_intrinsic_rotate): Likewise. * modules.cc (layout_moduleinfo_fields): Likewise. (layout_moduleinfo): Likewise. * runtime.cc (get_libcall_type): Likewise. * typeinfo.cc (make_frontend_typeinfo): Likewise. (TypeInfoVisitor::visit): Likewise. (create_typeinfo): Likewise. * types.cc (same_type_p): Likewise. (build_ctype): Likewise. libphobos/ChangeLog: * libdruntime/MERGE: Merge upstream druntime 9471b25db9. * src/MERGE: Merge upstream phobos 547886846.
Diffstat (limited to 'libphobos/libdruntime')
-rw-r--r--libphobos/libdruntime/MERGE2
-rw-r--r--libphobos/libdruntime/core/interpolation.d22
-rw-r--r--libphobos/libdruntime/core/thread/fiber.d21
-rw-r--r--libphobos/libdruntime/core/thread/osthread.d4
-rw-r--r--libphobos/libdruntime/core/thread/threadbase.d3
5 files changed, 29 insertions, 23 deletions
diff --git a/libphobos/libdruntime/MERGE b/libphobos/libdruntime/MERGE
index 74c194508f7..021149aabc7 100644
--- a/libphobos/libdruntime/MERGE
+++ b/libphobos/libdruntime/MERGE
@@ -1,4 +1,4 @@
-11240a96635074b2f79d908b9348e9c0fbc3c7dc
+9471b25db9ed44d71e0e27956430c0c6a09c16db
The first line of this file holds the git revision number of the last
merge done from the dlang/dmd repository.
diff --git a/libphobos/libdruntime/core/interpolation.d b/libphobos/libdruntime/core/interpolation.d
index 0d45fe79088..530602580f1 100644
--- a/libphobos/libdruntime/core/interpolation.d
+++ b/libphobos/libdruntime/core/interpolation.d
@@ -92,6 +92,14 @@
module core.interpolation;
/++
+ Common implementation for returning an empty string, to avoid storing
+ multiple versions of the same function based on templated types below.
++/
+public string __getEmptyString() @nogc pure nothrow @safe {
+ return "";
+}
+
+/++
Sentinel values to indicate the beginning and end of an
interpolated expression sequence.
@@ -104,9 +112,7 @@ struct InterpolationHeader {
Returns `null` for easy compatibility with existing functions
like `std.stdio.writeln` and `std.conv.text`.
+/
- string toString() const @nogc pure nothrow @safe {
- return null;
- }
+ alias toString = __getEmptyString;
}
/// ditto
@@ -115,9 +121,7 @@ struct InterpolationFooter {
Returns `null` for easy compatibility with existing functions
like `std.stdio.writeln` and `std.conv.text`.
+/
- string toString() const @nogc pure nothrow @safe {
- return null;
- }
+ alias toString = __getEmptyString;
}
/++
@@ -130,7 +134,7 @@ struct InterpolatedLiteral(string text) {
segment of the tuple, for easy access and compatibility with
existing functions like `std.stdio.writeln` and `std.conv.text`.
+/
- string toString() const @nogc pure nothrow @safe {
+ static string toString() @nogc pure nothrow @safe {
return text;
}
}
@@ -150,7 +154,5 @@ struct InterpolatedExpression(string text) {
Returns `null` for easy compatibility with existing functions
like `std.stdio.writeln` and `std.conv.text`.
+/
- string toString() const @nogc pure nothrow @safe {
- return null;
- }
+ alias toString = __getEmptyString;
}
diff --git a/libphobos/libdruntime/core/thread/fiber.d b/libphobos/libdruntime/core/thread/fiber.d
index 50253b09512..dd2462fbca1 100644
--- a/libphobos/libdruntime/core/thread/fiber.d
+++ b/libphobos/libdruntime/core/thread/fiber.d
@@ -14,7 +14,7 @@
*/
module core.thread.fiber;
-import core.thread.osthread;
+import core.thread.threadbase;
import core.thread.threadgroup;
import core.thread.types;
import core.thread.context;
@@ -220,8 +220,8 @@ private
Fiber obj = Fiber.getThis();
assert( obj );
- assert( Thread.getThis().m_curr is obj.m_ctxt );
- atomicStore!(MemoryOrder.raw)(*cast(shared)&Thread.getThis().m_lock, false);
+ assert( ThreadBase.getThis().m_curr is obj.m_ctxt );
+ atomicStore!(MemoryOrder.raw)(*cast(shared)&ThreadBase.getThis().m_lock, false);
obj.m_ctxt.tstack = obj.m_ctxt.bstack;
obj.m_state = Fiber.State.EXEC;
@@ -1106,7 +1106,7 @@ private:
}
}
- Thread.add( m_ctxt );
+ ThreadBase.add( m_ctxt );
}
@@ -1119,9 +1119,9 @@ private:
{
// NOTE: m_ctxt is guaranteed to be alive because it is held in the
// global context list.
- Thread.slock.lock_nothrow();
- scope(exit) Thread.slock.unlock_nothrow();
- Thread.remove( m_ctxt );
+ ThreadBase.slock.lock_nothrow();
+ scope(exit) ThreadBase.slock.unlock_nothrow();
+ ThreadBase.remove( m_ctxt );
version (Windows)
{
@@ -1623,7 +1623,7 @@ private:
//
final void switchIn() nothrow @nogc
{
- Thread tobj = Thread.getThis();
+ ThreadBase tobj = ThreadBase.getThis();
void** oldp = &tobj.m_curr.tstack;
void* newp = m_ctxt.tstack;
@@ -1657,7 +1657,7 @@ private:
//
final void switchOut() nothrow @nogc
{
- Thread tobj = Thread.getThis();
+ ThreadBase tobj = ThreadBase.getThis();
void** oldp = &m_ctxt.tstack;
void* newp = tobj.m_curr.within.tstack;
@@ -1682,7 +1682,7 @@ private:
// NOTE: If use of this fiber is multiplexed across threads, the thread
// executing here may be different from the one above, so get the
// current thread handle before unlocking, etc.
- tobj = Thread.getThis();
+ tobj = ThreadBase.getThis();
atomicStore!(MemoryOrder.raw)(*cast(shared)&tobj.m_lock, false);
tobj.m_curr.tstack = tobj.m_curr.bstack;
}
@@ -2027,6 +2027,7 @@ unittest
unittest
{
import core.memory;
+ import core.thread.osthread : Thread;
import core.time : dur;
static void unreferencedThreadObject()
diff --git a/libphobos/libdruntime/core/thread/osthread.d b/libphobos/libdruntime/core/thread/osthread.d
index 295ca52e350..a9fcf96254b 100644
--- a/libphobos/libdruntime/core/thread/osthread.d
+++ b/libphobos/libdruntime/core/thread/osthread.d
@@ -1625,7 +1625,7 @@ extern (C) @nogc nothrow
}
-package extern(D) void* getStackTop() nothrow @nogc
+private extern(D) void* getStackTop() nothrow @nogc
{
version (D_InlineAsm_X86)
asm pure nothrow @nogc { naked; mov EAX, ESP; ret; }
@@ -1638,7 +1638,7 @@ package extern(D) void* getStackTop() nothrow @nogc
}
-package extern(D) void* getStackBottom() nothrow @nogc
+private extern(D) void* getStackBottom() nothrow @nogc
{
version (Windows)
{
diff --git a/libphobos/libdruntime/core/thread/threadbase.d b/libphobos/libdruntime/core/thread/threadbase.d
index 84f9203f23b..f593387c755 100644
--- a/libphobos/libdruntime/core/thread/threadbase.d
+++ b/libphobos/libdruntime/core/thread/threadbase.d
@@ -84,7 +84,10 @@ private
enum mutexClassInstanceSize = __traits(classInstanceSize, Mutex);
alias swapContext = externDFunc!("core.thread.osthread.swapContext", void* function(void*) nothrow @nogc);
+}
+package
+{
alias getStackBottom = externDFunc!("core.thread.osthread.getStackBottom", void* function() nothrow @nogc);
alias getStackTop = externDFunc!("core.thread.osthread.getStackTop", void* function() nothrow @nogc);
}