diff options
| author | Iain Buclaw <ibuclaw@gdcproject.org> | 2025-01-05 14:24:49 +0100 |
|---|---|---|
| committer | Iain Buclaw <ibuclaw@gdcproject.org> | 2025-01-05 14:24:49 +0100 |
| commit | a676a516701789730aa482bcef4adcb683ba0140 (patch) | |
| tree | 6c5b56d13162e537bae0ed373a9addf9be73af56 /libphobos/libdruntime | |
| parent | 3dfad340cb140d64b8c0ecab05fa329238ebd06b (diff) | |
d: Merge upstream dmd, druntime 07bc5b9b3c, phobos de1dea109
Synchronizing with the upstream release of v2.109.0.
D front-end changes:
- Import dmd v2.109.0.
D runtime changes:
- Import druntime v2.109.0.
Phobos changes:
- Import phobos v2.109.0.
gcc/d/ChangeLog:
* decl.cc (DeclVisitor::finish_vtable): Update for new front-end
interface.
* dmd/MERGE: Merge upstream dmd 07bc5b9b3c.
* dmd/VERSION: Bump version to v2.109.0.
libphobos/ChangeLog:
* libdruntime/MERGE: Merge upstream druntime 07bc5b9b3c.
* src/MERGE: Merge upstream phobos de1dea109.
Diffstat (limited to 'libphobos/libdruntime')
19 files changed, 34 insertions, 735 deletions
diff --git a/libphobos/libdruntime/MERGE b/libphobos/libdruntime/MERGE index 46d435ef8db..77e8562abcc 100644 --- a/libphobos/libdruntime/MERGE +++ b/libphobos/libdruntime/MERGE @@ -1,4 +1,4 @@ -c11e1d1708646c9ac81ac2aafb57fa1ef5d289ad +07bc5b9b3c81cc0d4314e0040de981124b363ea5 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/attribute.d b/libphobos/libdruntime/core/attribute.d index 79ad25ab358..95a67ea219d 100644 --- a/libphobos/libdruntime/core/attribute.d +++ b/libphobos/libdruntime/core/attribute.d @@ -2,6 +2,21 @@ * This module contains UDA's (User Defined Attributes) either used in * the runtime or special UDA's recognized by compiler. * + * $(SCRIPT inhibitQuickIndex = 1;) + * $(BOOKTABLE Cheat Sheet, + * $(THEAD Attribute Name, Linkage, Description) + * $(TROW $(LREF gnuAbiTag), C++, + * Declares an ABI tag on a C++ symbol.) + * $(TROW $(LREF mustuse),, + * Ensures that values of a struct or union type are not discarded.) + * $(TROW $(LREF optional), Objective-C, + * Makes an Objective-C interface method optional.) + * $(TROW $(LREF selector), Objective-C, + * Attaches an Objective-C selector to a method.) + * $(TROW $(LREF weak),, + * Specifies that a global symbol should be emitted with weak linkage.) + * ) + * * Copyright: Copyright Jacob Carlborg 2015. * License: $(LINK2 http://www.boost.org/LICENSE_1_0.txt, Boost License 1.0) * Authors: Jacob Carlborg diff --git a/libphobos/libdruntime/core/demangle.d b/libphobos/libdruntime/core/demangle.d index 272ee1e1ba4..4405dec2639 100644 --- a/libphobos/libdruntime/core/demangle.d +++ b/libphobos/libdruntime/core/demangle.d @@ -2867,56 +2867,6 @@ unittest assert(demangle(aggr.mangleof) == "pure nothrow @nogc @safe void " ~ parent ~ "().aggr(" ~ parent ~ "().S!(noreturn).S)"); } -/* - * Expand an OMF, DMD-generated compressed identifier into its full form - * - * This function only has a visible effect for OMF binaries (Win32), - * as compression is otherwise not used. - * - * See_Also: `compiler/src/dmd/backend/compress.d` - */ -string decodeDmdString( const(char)[] ln, ref size_t p ) nothrow pure @safe -{ - string s; - uint zlen, zpos; - - // decompress symbol - while ( p < ln.length ) - { - int ch = cast(ubyte) ln[p++]; - if ( (ch & 0xc0) == 0xc0 ) - { - zlen = (ch & 0x7) + 1; - zpos = ((ch >> 3) & 7) + 1; // + zlen; - if ( zpos > s.length ) - break; - s ~= s[$ - zpos .. $ - zpos + zlen]; - } - else if ( ch >= 0x80 ) - { - if ( p >= ln.length ) - break; - int ch2 = cast(ubyte) ln[p++]; - zlen = (ch2 & 0x7f) | ((ch & 0x38) << 4); - if ( p >= ln.length ) - break; - int ch3 = cast(ubyte) ln[p++]; - zpos = (ch3 & 0x7f) | ((ch & 7) << 7); - if ( zpos > s.length ) - break; - s ~= s[$ - zpos .. $ - zpos + zlen]; - } - else if ( Demangle!().isAlpha(cast(char)ch) || Demangle!().isDigit(cast(char)ch) || ch == '_' ) - s ~= cast(char) ch; - else - { - p--; - break; - } - } - return s; -} - // locally purified for internal use here only extern (C) private { diff --git a/libphobos/libdruntime/core/internal/parseoptions.d b/libphobos/libdruntime/core/internal/parseoptions.d index ac0eb826b35..2bf1da2fbfa 100644 --- a/libphobos/libdruntime/core/internal/parseoptions.d +++ b/libphobos/libdruntime/core/internal/parseoptions.d @@ -290,32 +290,8 @@ do assert(n > 4 && n < fmt.length); int nscanned; - version (CRuntime_DigitalMars) - { - /* Older sscanf's in snn.lib can write to its first argument, causing a crash - * if the string is in readonly memory. Recent updates to DMD - * https://github.com/dlang/dmd/pull/6546 - * put string literals in readonly memory. - * Although sscanf has been fixed, - * http://ftp.digitalmars.com/snn.lib - * this workaround is here so it still works with the older snn.lib. - */ - // Create mutable copy of str - const length = str.length; - char* mptr = cast(char*)malloc(length + 1); - assert(mptr); - memcpy(mptr, str.ptr, length); - mptr[length] = 0; - const result = sscanf(mptr, fmt.ptr, &res, &nscanned); - free(mptr); - if (result < 1) - return parseError("a float", optname, str, errName); - } - else - { - if (sscanf(str.ptr, fmt.ptr, &res, &nscanned) < 1) - return parseError("a float", optname, str, errName); - } + if (sscanf(str.ptr, fmt.ptr, &res, &nscanned) < 1) + return parseError("a float", optname, str, errName); str = str[nscanned .. $]; return true; } diff --git a/libphobos/libdruntime/core/stdc/assert_.d b/libphobos/libdruntime/core/stdc/assert_.d index c6d9d9f6cc2..ac237d9c897 100644 --- a/libphobos/libdruntime/core/stdc/assert_.d +++ b/libphobos/libdruntime/core/stdc/assert_.d @@ -30,14 +30,7 @@ extern (C): nothrow: @nogc: -version (CRuntime_DigitalMars) -{ - /*** - * Assert failure function in the Digital Mars C library. - */ - noreturn _assert(const(void)* exp, const(void)* file, uint line); -} -else version (CRuntime_Microsoft) +version (CRuntime_Microsoft) { /*** * Assert failure function in the Microsoft C library. diff --git a/libphobos/libdruntime/core/stdc/errno.d b/libphobos/libdruntime/core/stdc/errno.d index ddec70f7af3..0430e6b33e9 100644 --- a/libphobos/libdruntime/core/stdc/errno.d +++ b/libphobos/libdruntime/core/stdc/errno.d @@ -43,15 +43,7 @@ version (X86_64) version = X86_Any; nothrow: @nogc: -version (CRuntime_DigitalMars) -{ - extern (C) - { - ref int _errno(); - alias errno = _errno; - } -} -else version (CRuntime_Microsoft) +version (CRuntime_Microsoft) { extern (C) { @@ -172,93 +164,7 @@ else extern (C): -version (CRuntime_DigitalMars) -{ - enum EPERM = 1; /// Operation not permitted - enum ENOENT = 2; /// No such file or directory - enum ESRCH = 3; /// No such process - enum EINTR = 4; /// Interrupted system call - enum EIO = 5; /// I/O error - enum ENXIO = 6; /// No such device or address - enum E2BIG = 7; /// Argument list too long - enum ENOEXEC = 8; /// Exec format error - enum EBADF = 9; /// Bad file number - enum ECHILD = 10; /// No child processes - enum EAGAIN = 11; /// Try again - enum ENOMEM = 12; /// Out of memory - enum EACCES = 13; /// Permission denied - enum EFAULT = 14; /// Bad address - enum EBUSY = 16; /// Device or resource busy - enum EEXIST = 17; /// File exists - enum EXDEV = 18; /// Cross-device link - enum ENODEV = 19; /// No such device - enum ENOTDIR = 20; /// Not a directory - enum EISDIR = 21; /// Is a directory - enum EINVAL = 22; /// Invalid argument - enum ENFILE = 23; /// File table overflow - enum EMFILE = 24; /// Too many open files - enum ENOTTY = 25; /// Not a typewriter - enum EFBIG = 27; /// File too large - enum ENOSPC = 28; /// No space left on device - enum ESPIPE = 29; /// Illegal seek - enum EROFS = 30; /// Read-only file system - enum EMLINK = 31; /// Too many links - enum EPIPE = 32; /// Broken pipe - enum EDOM = 33; /// Math argument out of domain of func - enum ERANGE = 34; /// Math result not representable - enum EDEADLK = 36; /// Resource deadlock would occur - enum ENAMETOOLONG = 38; /// File name too long - enum ENOLCK = 39; /// No record locks available - enum ENOSYS = 40; /// Function not implemented - enum ENOTEMPTY = 41; /// Directory not empty - enum EILSEQ = 42; /// Illegal byte sequence - enum EDEADLOCK = EDEADLK; /// Resource deadlock would occur - - // POSIX compatibility - // See_Also: https://docs.microsoft.com/en-us/cpp/c-runtime-library/errno-constants - enum EADDRINUSE = 100; - enum EADDRNOTAVAIL = 101; - enum EAFNOSUPPORT = 102; - enum EALREADY = 103; - enum EBADMSG = 104; - enum ECANCELED = 105; - enum ECONNABORTED = 106; - enum ECONNREFUSED = 107; - enum ECONNRESET = 108; - enum EDESTADDRREQ = 109; - enum EHOSTUNREACH = 110; - enum EIDRM = 111; - enum EINPROGRESS = 112; - enum EISCONN = 113; - enum ELOOP = 114; - enum EMSGSIZE = 115; - enum ENETDOWN = 116; - enum ENETRESET = 117; - enum ENETUNREACH = 118; - enum ENOBUFS = 119; - enum ENODATA = 120; - enum ENOLINK = 121; - enum ENOMSG = 122; - enum ENOPROTOOPT = 123; - enum ENOSR = 124; - enum ENOSTR = 125; - enum ENOTCONN = 126; - enum ENOTRECOVERABLE = 127; - enum ENOTSOCK = 128; - enum ENOTSUP = 129; - enum EOPNOTSUPP = 130; - enum EOTHER = 131; - enum EOVERFLOW = 132; - enum EOWNERDEAD = 133; - enum EPROTO = 134; - enum EPROTONOSUPPORT = 135; - enum EPROTOTYPE = 136; - enum ETIME = 137; - enum ETIMEDOUT = 138; - enum ETXTBSY = 139; - enum EWOULDBLOCK = 140; -} -else version (CRuntime_Microsoft) +version (CRuntime_Microsoft) { enum EPERM = 1; /// Operation not permitted enum ENOENT = 2; /// No such file or directory diff --git a/libphobos/libdruntime/core/stdc/fenv.d b/libphobos/libdruntime/core/stdc/fenv.d index a7364c0a211..6cd75f3a791 100644 --- a/libphobos/libdruntime/core/stdc/fenv.d +++ b/libphobos/libdruntime/core/stdc/fenv.d @@ -180,17 +180,6 @@ version (GNUFP) static assert(0, "Unimplemented architecture"); } } -else version (CRuntime_DigitalMars) -{ - struct fenv_t - { - ushort status; - ushort control; - ushort round; - ushort[2] reserved; - } - alias fexcept_t = int; -} else version (CRuntime_Microsoft) { struct fenv_t @@ -872,12 +861,6 @@ version (GNUFP) /// enum FE_DFL_ENV = cast(fenv_t*)(-1); } -else version (CRuntime_DigitalMars) -{ - private extern __gshared fenv_t _FE_DFL_ENV; - /// - enum fenv_t* FE_DFL_ENV = &_FE_DFL_ENV; -} else version (CRuntime_Microsoft) { private extern __gshared fenv_t _Fenv0; diff --git a/libphobos/libdruntime/core/stdc/math.d b/libphobos/libdruntime/core/stdc/math.d index c5eaf79a827..e54d5813995 100644 --- a/libphobos/libdruntime/core/stdc/math.d +++ b/libphobos/libdruntime/core/stdc/math.d @@ -284,102 +284,7 @@ version (none) pure int isunordered(real x, real y); } -version (CRuntime_DigitalMars) -{ - enum - { - /// - FP_NANS = 0, - /// - FP_NANQ = 1, - /// - FP_INFINITE = 2, - /// - FP_NORMAL = 3, - /// - FP_SUBNORMAL = 4, - /// - FP_ZERO = 5, - /// - FP_NAN = FP_NANQ, - /// - FP_EMPTY = 6, - /// - FP_UNSUPPORTED = 7, - } - - enum - { - /// - FP_FAST_FMA = 0, - /// - FP_FAST_FMAF = 0, - /// - FP_FAST_FMAL = 0, - } - - pure uint __fpclassify_f(float x); - pure uint __fpclassify_d(double x); - pure uint __fpclassify_ld(real x); - - //int fpclassify(real-floating x); - /// - pragma(mangle, "__fpclassify_f") pure int fpclassify(float x); - /// - pragma(mangle, "__fpclassify_d") pure int fpclassify(double x); - /// - pragma(mangle, real.sizeof == double.sizeof ? "__fpclassify_d" : "__fpclassify_ld") - pure int fpclassify(real x); - - extern (D) - { - //int isfinite(real-floating x); - /// - pure int isfinite(float x) { return fpclassify(x) >= FP_NORMAL; } - /// - pure int isfinite(double x) { return fpclassify(x) >= FP_NORMAL; } - /// - pure int isfinite(real x) { return fpclassify(x) >= FP_NORMAL; } - - //int isinf(real-floating x); - /// - pure int isinf(float x) { return fpclassify(x) == FP_INFINITE; } - /// - pure int isinf(double x) { return fpclassify(x) == FP_INFINITE; } - /// - pure int isinf(real x) { return fpclassify(x) == FP_INFINITE; } - - //int isnan(real-floating x); - /// - pure int isnan(float x) { return fpclassify(x) <= FP_NANQ; } - /// - pure int isnan(double x) { return fpclassify(x) <= FP_NANQ; } - /// - pure int isnan(real x) { return fpclassify(x) <= FP_NANQ; } - - //int isnormal(real-floating x); - /// - pure int isnormal(float x) { return fpclassify(x) == FP_NORMAL; } - /// - pure int isnormal(double x) { return fpclassify(x) == FP_NORMAL; } - /// - pure int isnormal(real x) { return fpclassify(x) == FP_NORMAL; } - - //int signbit(real-floating x); - /// - pure int signbit(float x) { return (cast(short*)&(x))[1] & 0x8000; } - /// - pure int signbit(double x) { return (cast(short*)&(x))[3] & 0x8000; } - /// - pure int signbit(real x) - { - return (real.sizeof == double.sizeof) - ? (cast(short*)&(x))[3] & 0x8000 - : (cast(short*)&(x))[4] & 0x8000; - } - } -} -else version (CRuntime_Microsoft) // fully supported since MSVCRT 12 (VS 2013) only +version (CRuntime_Microsoft) // fully supported since MSVCRT 12 (VS 2013) only { version (all) // legacy stuff to be removed in the future { diff --git a/libphobos/libdruntime/core/stdc/stdint.d b/libphobos/libdruntime/core/stdc/stdint.d index 476c42f08ee..1776269378f 100644 --- a/libphobos/libdruntime/core/stdc/stdint.d +++ b/libphobos/libdruntime/core/stdc/stdint.d @@ -49,16 +49,8 @@ version (Windows) alias int16_t = short; /// alias uint8_t = ubyte; /// alias uint16_t = ushort; /// - version (CRuntime_DigitalMars) - { - alias int32_t = cpp_long; /// - alias uint32_t = cpp_ulong; /// - } - else - { - alias int32_t = int; /// - alias uint32_t = uint; /// - } + alias int32_t = int; /// + alias uint32_t = uint; /// alias int64_t = long; /// alias uint64_t = ulong; /// diff --git a/libphobos/libdruntime/core/stdc/stdio.d b/libphobos/libdruntime/core/stdc/stdio.d index 1fc046163ee..8afb68f8585 100644 --- a/libphobos/libdruntime/core/stdc/stdio.d +++ b/libphobos/libdruntime/core/stdc/stdio.d @@ -52,34 +52,7 @@ extern (C): nothrow: @nogc: -version (CRuntime_DigitalMars) -{ - enum - { - /// - BUFSIZ = 0x4000, - /// - EOF = -1, - /// - FOPEN_MAX = 20, - /// - FILENAME_MAX = 256, // 255 plus NULL - /// - TMP_MAX = 32767, - /// - SYS_OPEN = 20, // non-standard - } - - /// - enum int _NFILE = 60; // non-standard - /// - enum string _P_tmpdir = "\\"; // non-standard - /// - enum wstring _wP_tmpdir = "\\"; // non-standard - /// - enum int L_tmpnam = _P_tmpdir.length + 12; -} -else version (CRuntime_Microsoft) +version (CRuntime_Microsoft) { enum { @@ -403,28 +376,7 @@ enum SEEK_END } -version (CRuntime_DigitalMars) -{ - /// - alias c_long fpos_t; - - /// - struct _iobuf - { - char* _ptr; - int _cnt; - char* _base; - int _flag; - int _file; - int _charbuf; - int _bufsiz; - char* __tmpnum; - } - - /// - alias shared(_iobuf) FILE; -} -else version (CRuntime_Microsoft) +version (CRuntime_Microsoft) { /// alias long fpos_t; @@ -926,52 +878,7 @@ enum _F_TERM = 0x0200, // non-standard } -version (CRuntime_DigitalMars) -{ - enum - { - /// - _IOFBF = 0, - /// - _IOLBF = 0x40, - /// - _IONBF = 4, - /// - _IOREAD = 1, // non-standard - /// - _IOWRT = 2, // non-standard - /// - _IOMYBUF = 8, // non-standard - /// - _IOEOF = 0x10, // non-standard - /// - _IOERR = 0x20, // non-standard - /// - _IOSTRG = 0x40, // non-standard - /// - _IORW = 0x80, // non-standard - /// - _IOTRAN = 0x100, // non-standard - /// - _IOAPP = 0x200, // non-standard - } - - extern shared void function() _fcloseallp; - - private extern shared FILE[_NFILE] _iob; - - /// - enum stdin = &_iob[0]; - /// - enum stdout = &_iob[1]; - /// - enum stderr = &_iob[2]; - /// - enum stdaux = &_iob[3]; - /// - enum stdprn = &_iob[4]; -} -else version (CRuntime_Microsoft) +version (CRuntime_Microsoft) { enum { @@ -1539,55 +1446,7 @@ size_t fwrite(scope const void* ptr, size_t size, size_t nmemb, FILE* stream); c_long ftell(FILE* stream); } -version (CRuntime_DigitalMars) -{ - // No unsafe pointer manipulation. - extern (D) @trusted - { - /// - void rewind()(FILE* stream) { fseek(stream,0L,SEEK_SET); stream._flag= stream._flag & ~_IOERR; } - /// - pure void clearerr()(FILE* stream) { stream._flag = stream._flag & ~(_IOERR|_IOEOF); } - /// - pure int feof()(FILE* stream) { return stream._flag&_IOEOF; } - /// - pure int ferror()(FILE* stream) { return stream._flag&_IOERR; } - /// - pure int fileno()(FILE* stream) { return stream._file; } - } - /// - pragma(printf) - int _snprintf(scope char* s, size_t n, scope const char* fmt, scope const ...); - /// - alias _snprintf snprintf; - - /// - pragma(printf) - int _vsnprintf(scope char* s, size_t n, scope const char* format, va_list arg); - /// - alias _vsnprintf vsnprintf; - - // - // Digital Mars under-the-hood C I/O functions. Uses _iobuf* for the - // unshared version of FILE*, usable when the FILE is locked. - // - - /// - int _fputc_nlock(int c, _iobuf* fp); - /// - int _fputwc_nlock(int c, _iobuf* fp); - /// - int _fgetc_nlock(_iobuf* fp); - /// - int _fgetwc_nlock(_iobuf* fp); - /// - int __fp_lock(FILE* fp); - /// - void __fp_unlock(FILE* fp); - /// - int setmode(int fd, int mode); -} -else version (CRuntime_Microsoft) +version (CRuntime_Microsoft) { // No unsafe pointer manipulation. @trusted @@ -2073,130 +1932,7 @@ else /// void perror(scope const char* s); -version (CRuntime_DigitalMars) -{ - version (none) - import core.sys.windows.windows : HANDLE, _WaitSemaphore, _ReleaseSemaphore; - else - { - // too slow to import windows - private alias void* HANDLE; - private void _WaitSemaphore(int iSemaphore); - private void _ReleaseSemaphore(int iSemaphore); - } - - enum - { - /// - FHND_APPEND = 0x04, - /// - FHND_DEVICE = 0x08, - /// - FHND_TEXT = 0x10, - /// - FHND_BYTE = 0x20, - /// - FHND_WCHAR = 0x40, - } - - private enum _MAX_SEMAPHORES = 10 + _NFILE; - private enum _semIO = 3; - - private extern __gshared short[_MAX_SEMAPHORES] _iSemLockCtrs; - private extern __gshared int[_MAX_SEMAPHORES] _iSemThreadIds; - private extern __gshared int[_MAX_SEMAPHORES] _iSemNestCount; - private extern __gshared HANDLE[_NFILE] _osfhnd; - extern shared ubyte[_NFILE] __fhnd_info; - - // this is copied from semlock.h in DMC's runtime. - private void LockSemaphore()(uint num) - { - asm nothrow @nogc - { - mov EDX, num; - lock; - inc _iSemLockCtrs[EDX * 2]; - jz lsDone; - push EDX; - call _WaitSemaphore; - add ESP, 4; - } - - lsDone: {} - } - - // this is copied from semlock.h in DMC's runtime. - private void UnlockSemaphore()(uint num) - { - asm nothrow @nogc - { - mov EDX, num; - lock; - dec _iSemLockCtrs[EDX * 2]; - js usDone; - push EDX; - call _ReleaseSemaphore; - add ESP, 4; - } - - usDone: {} - } - - // This converts a HANDLE to a file descriptor in DMC's runtime - /// - int _handleToFD()(HANDLE h, int flags) - { - LockSemaphore(_semIO); - scope(exit) UnlockSemaphore(_semIO); - - foreach (fd; 0 .. _NFILE) - { - if (!_osfhnd[fd]) - { - _osfhnd[fd] = h; - __fhnd_info[fd] = cast(ubyte)flags; - return fd; - } - } - - return -1; - } - - /// - HANDLE _fdToHandle()(int fd) - { - // no semaphore is required, once inserted, a file descriptor - // doesn't change. - if (fd < 0 || fd >= _NFILE) - return null; - - return _osfhnd[fd]; - } - - enum - { - /// - STDIN_FILENO = 0, - /// - STDOUT_FILENO = 1, - /// - STDERR_FILENO = 2, - } - - int open(scope const(char)* filename, int flags, ...); /// - alias _open = open; /// - int _wopen(scope const wchar* filename, int oflag, ...); /// - int sopen(scope const char* filename, int oflag, int shflag, ...); /// - alias _sopen = sopen; /// - int _wsopen(scope const wchar* filename, int oflag, int shflag, ...); /// - int close(int fd); /// - alias _close = close; /// - FILE *fdopen(int fd, scope const(char)* flags); /// - alias _fdopen = fdopen; /// - FILE *_wfdopen(int fd, scope const(wchar)* flags); /// - -} -else version (CRuntime_Microsoft) +version (CRuntime_Microsoft) { int _open(scope const char* filename, int oflag, ...); /// int _wopen(scope const wchar* filename, int oflag, ...); /// diff --git a/libphobos/libdruntime/core/stdcpp/array.d b/libphobos/libdruntime/core/stdcpp/array.d index eb63d4ccaab..4cb0c56ec5f 100644 --- a/libphobos/libdruntime/core/stdcpp/array.d +++ b/libphobos/libdruntime/core/stdcpp/array.d @@ -13,17 +13,6 @@ module core.stdcpp.array; import core.stdcpp.xutility : StdNamespace; -// hacks to support DMD on Win32 -version (CppRuntime_Microsoft) -{ - version = CppRuntime_Windows; // use the MS runtime ABI for win32 -} -else version (CppRuntime_DigitalMars) -{ - version = CppRuntime_Windows; // use the MS runtime ABI for win32 - pragma(msg, "std::array not supported by DMC"); -} - extern(C++, (StdNamespace)): /** @@ -73,7 +62,7 @@ pure nothrow @nogc: /// ref inout(T) back() inout @safe { static if (N > 0) { return this[N-1]; } else { return as_array()[][0]; /* HACK: force OOB */ } } - version (CppRuntime_Windows) + version (CppRuntime_Microsoft) { /// inout(T)* data() inout @safe { return &_Elems[0]; } diff --git a/libphobos/libdruntime/core/stdcpp/exception.d b/libphobos/libdruntime/core/stdcpp/exception.d index d5339964e36..4774b98615b 100644 --- a/libphobos/libdruntime/core/stdcpp/exception.d +++ b/libphobos/libdruntime/core/stdcpp/exception.d @@ -80,24 +80,6 @@ version (GenericBaseException) extern(D) this(const(char)*, int = 1) nothrow { this(); } // compat with MS derived classes } } -else version (CppRuntime_DigitalMars) -{ - /// - class exception - { - @nogc: - /// - extern(D) this() nothrow {} - //virtual ~this(); - void dtor() { } // reserve slot in vtbl[] - - /// - const(char)* what() const nothrow; - - protected: - this(const(char)*, int = 1) nothrow { this(); } // compat with MS derived classes - } -} else version (CppRuntime_Microsoft) { /// diff --git a/libphobos/libdruntime/core/stdcpp/string_view.d b/libphobos/libdruntime/core/stdcpp/string_view.d index 172c170444b..47f58b014ef 100644 --- a/libphobos/libdruntime/core/stdcpp/string_view.d +++ b/libphobos/libdruntime/core/stdcpp/string_view.d @@ -14,17 +14,6 @@ module core.stdcpp.string_view; import core.stdc.stddef : wchar_t; import core.stdcpp.xutility : StdNamespace; -// hacks to support DMD on Win32 -version (CppRuntime_Microsoft) -{ - version = CppRuntime_Windows; // use the MS runtime ABI for win32 -} -else version (CppRuntime_DigitalMars) -{ - version = CppRuntime_Windows; // use the MS runtime ABI for win32 - pragma(msg, "std::basic_string_view not supported by DMC"); -} - extern(C++, (StdNamespace)): @nogc: @@ -102,7 +91,7 @@ pure nothrow @nogc: private: // use the proper field names from C++ so debugging doesn't get weird - version (CppRuntime_Windows) + version (CppRuntime_Microsoft) { const_pointer _Mydata; size_type _Mysize; diff --git a/libphobos/libdruntime/core/stdcpp/typeinfo.d b/libphobos/libdruntime/core/stdcpp/typeinfo.d index 24f2938ccab..b8478b39414 100644 --- a/libphobos/libdruntime/core/stdcpp/typeinfo.d +++ b/libphobos/libdruntime/core/stdcpp/typeinfo.d @@ -13,53 +13,7 @@ module core.stdcpp.typeinfo; import core.attribute : weak; -version (CppRuntime_DigitalMars) -{ - import core.stdcpp.exception; - - extern (C++, "std"): - - class type_info - { - @nogc: - void* pdata; - - public: - //virtual ~this(); - void dtor() { } // reserve slot in vtbl[] - - //bool operator==(const type_info rhs) const; - //bool operator!=(const type_info rhs) const; - final bool before(const type_info rhs) const nothrow; - final const(char)* name() const nothrow; - protected: - //type_info(); - private: - //this(const type_info rhs); - //type_info operator=(const type_info rhs); - } - - class bad_cast : exception - { - @nogc: - extern(D) this() nothrow { } - extern(D) this(const bad_cast) nothrow { } - //bad_cast operator=(const bad_cast) nothrow { return this; } - //virtual ~this() nothrow; - override const(char)* what() const nothrow; - } - - class bad_typeid : exception - { - @nogc: - extern(D) this() nothrow { } - extern(D) this(const bad_typeid) nothrow { } - //bad_typeid operator=(const bad_typeid) nothrow { return this; } - //virtual ~this() nothrow; - override const (char)* what() const nothrow; - } -} -else version (CppRuntime_Microsoft) +version (CppRuntime_Microsoft) { import core.stdcpp.exception; diff --git a/libphobos/libdruntime/core/sys/windows/dll.d b/libphobos/libdruntime/core/sys/windows/dll.d index 77141d5deb3..6a003b5c633 100644 --- a/libphobos/libdruntime/core/sys/windows/dll.d +++ b/libphobos/libdruntime/core/sys/windows/dll.d @@ -32,13 +32,7 @@ extern (C) { version (Win32) { - version (CRuntime_DigitalMars) - { - extern __gshared byte _tlsstart; - extern __gshared byte _tlsend; - extern __gshared void* _tls_callbacks_a; - } - else version (CRuntime_Microsoft) + version (CRuntime_Microsoft) { extern __gshared byte _tls_start; extern __gshared byte _tls_end; diff --git a/libphobos/libdruntime/core/sys/windows/stacktrace.d b/libphobos/libdruntime/core/sys/windows/stacktrace.d index a73fc9ce4d2..29ffc1b0785 100644 --- a/libphobos/libdruntime/core/sys/windows/stacktrace.d +++ b/libphobos/libdruntime/core/sys/windows/stacktrace.d @@ -309,13 +309,6 @@ private: auto res = formatStackFrame(pc); res ~= " in "; const(char)[] tempSymName = symName[0 .. strlen(symName)]; - // Deal with dmd mangling of long names for OMF 32 bits builds - // Note that `target.d` only defines `CRuntime_DigitalMars` for OMF builds - version (CRuntime_DigitalMars) - { - size_t decodeIndex = 0; - tempSymName = decodeDmdString(tempSymName, decodeIndex); - } res ~= demangle(tempSymName, demangleBuf); return res; } @@ -339,34 +332,6 @@ private: } -// Workaround OPTLINK bug (Bugzilla 8263) -extern(Windows) BOOL FixupDebugHeader(HANDLE hProcess, ULONG ActionCode, - ulong CallbackContext, ulong UserContext) -{ - if (ActionCode == CBA_READ_MEMORY) - { - auto p = cast(IMAGEHLP_CBA_READ_MEMORY*)CallbackContext; - if (!(p.addr & 0xFF) && p.bytes == 0x1C && - // IMAGE_DEBUG_DIRECTORY.PointerToRawData - (*cast(DWORD*)(p.addr + 24) & 0xFF) == 0x20) - { - immutable base = DbgHelp.get().SymGetModuleBase64(hProcess, p.addr); - // IMAGE_DEBUG_DIRECTORY.AddressOfRawData - if (base + *cast(DWORD*)(p.addr + 20) == p.addr + 0x1C && - *cast(DWORD*)(p.addr + 0x1C) == 0 && - *cast(DWORD*)(p.addr + 0x20) == ('N'|'B'<<8|'0'<<16|'9'<<24)) - { - debug(PRINTF) printf("fixup IMAGE_DEBUG_DIRECTORY.AddressOfRawData\n"); - memcpy(p.buf, cast(void*)p.addr, 0x1C); - *cast(DWORD*)(p.buf + 20) = cast(DWORD)(p.addr - base) + 0x20; - *p.bytesread = 0x1C; - return TRUE; - } - } - } - return FALSE; -} - private string generateSearchPath() { __gshared string[3] defaultPathList = ["_NT_SYMBOL_PATH", @@ -427,8 +392,6 @@ shared static this() if (!dbghelp.SymInitialize(hProcess, generateSearchPath().ptr, TRUE)) return; - dbghelp.SymRegisterCallback64(hProcess, &FixupDebugHeader, 0); - InitializeCriticalSection(&mutex); initialized = true; } diff --git a/libphobos/libdruntime/core/sys/windows/stat.d b/libphobos/libdruntime/core/sys/windows/stat.d index c87c7498873..85ed24f93d8 100644 --- a/libphobos/libdruntime/core/sys/windows/stat.d +++ b/libphobos/libdruntime/core/sys/windows/stat.d @@ -31,29 +31,7 @@ int S_ISDIR(int m) { return (m & S_IFMT) == S_IFDIR; } int S_ISCHR(int m) { return (m & S_IFMT) == S_IFCHR; } } -version (CRuntime_DigitalMars) -{ - struct struct_stat - { - short st_dev; - ushort st_ino; - ushort st_mode; - short st_nlink; - ushort st_uid; - ushort st_gid; - short st_rdev; - short dummy; - int st_size; - time_t st_atime; - time_t st_mtime; - time_t st_ctime; - } - - int stat(const(char)*, struct_stat *); - int fstat(int, struct_stat *) @trusted; - int _wstat(const(wchar)*, struct_stat *); -} -else version (CRuntime_Microsoft) +version (CRuntime_Microsoft) { struct struct_stat { diff --git a/libphobos/libdruntime/rt/monitor_.d b/libphobos/libdruntime/rt/monitor_.d index c1f3f3cb9a7..cbe2a484402 100644 --- a/libphobos/libdruntime/rt/monitor_.d +++ b/libphobos/libdruntime/rt/monitor_.d @@ -173,10 +173,6 @@ alias DEvent = void delegate(Object); version (Windows) { - version (CRuntime_DigitalMars) - { - pragma(lib, "snn.lib"); - } import core.sys.windows.winbase /+: CRITICAL_SECTION, DeleteCriticalSection, EnterCriticalSection, InitializeCriticalSection, LeaveCriticalSection+/; diff --git a/libphobos/libdruntime/rt/sections.d b/libphobos/libdruntime/rt/sections.d index 65f57892ee7..6a155520340 100644 --- a/libphobos/libdruntime/rt/sections.d +++ b/libphobos/libdruntime/rt/sections.d @@ -54,8 +54,6 @@ else version (Darwin) else static assert(0, "unimplemented"); } -else version (CRuntime_DigitalMars) - public import rt.sections_win32; else version (CRuntime_Microsoft) public import rt.sections_win64; else version (CRuntime_Bionic) |
