From 47771d49fd728d0ef8138bf03ee98871f5ac0968 Mon Sep 17 00:00:00 2001 From: Martin Kinkelin Date: Sat, 25 May 2024 19:34:44 +0200 Subject: [PATCH] Get rid of obsolete DMC special cases --- .azure-pipelines/lib.sh | 14 -------------- .azure-pipelines/windows.sh | 17 +++++++---------- compiler/src/dmd/link.d | 6 ------ compiler/test/README.md | 2 +- compiler/test/compilable/stdcheaders.c | 16 ---------------- compiler/test/dshell/cpp_header_gen.d | 10 ---------- .../test/runnable_cxx/extra-files/cpp7925.cpp | 4 ---- .../runnable_cxx/extra-files/cpp_abi_tests.cpp | 8 +------- compiler/test/runnable_cxx/extra-files/cppb.cpp | 4 +--- .../runnable_cxx/extra-files/externmangle.cpp | 2 -- .../test/runnable_cxx/extra-files/test20652.cpp | 5 ----- compiler/test/tools/d_do_test.d | 4 ++-- compiler/test/tools/exported_vars.sh | 6 +++--- druntime/src/rt/alloca.d | 16 ---------------- 14 files changed, 15 insertions(+), 99 deletions(-) diff --git a/.azure-pipelines/lib.sh b/.azure-pipelines/lib.sh index f1060a9f8c50..64e0fed32e27 100644 --- a/.azure-pipelines/lib.sh +++ b/.azure-pipelines/lib.sh @@ -44,20 +44,6 @@ install_host_dmd() { dmd --version } -################################################################################ -# Download dmc -################################################################################ - -install_host_dmc() { - if [ ! -f dm/README.TXT ]; then - download "https://downloads.dlang.org/other/dm857c.zip" dmc.zip - 7z x dmc.zip > /dev/null - download "http://ftp.digitalmars.com/sppn.zip" sppn.zip - 7z x -odm/bin sppn.zip > /dev/null - fi - dm/bin/dmc | head -n 1 || true -} - ################################################################################ # Download Grep ################################################################################ diff --git a/.azure-pipelines/windows.sh b/.azure-pipelines/windows.sh index d083eda1f904..59db08e3ec2f 100644 --- a/.azure-pipelines/windows.sh +++ b/.azure-pipelines/windows.sh @@ -71,15 +71,12 @@ if [[ "$HOST_DMD_VERSION" == "2.079.0" ]]; then disable_debug_for_unittests=(ENABLE_DEBUG=0) fi -# avoid the DMC runtime and its limitations for the compiler and {build,run}.d tools themselves -TOOL_MODEL="$MODEL" - cd "$DMD_DIR" -"$HOST_DC" -m$TOOL_MODEL compiler/src/build.d -ofgenerated/build.exe -generated/build.exe -j$N MODEL=$TOOL_MODEL HOST_DMD=$HOST_DC BUILD=debug "${disable_debug_for_unittests[@]}" unittest -generated/build.exe -j$N MODEL=$TOOL_MODEL HOST_DMD=$HOST_DC DFLAGS="-L-LARGEADDRESSAWARE" ENABLE_RELEASE=1 ENABLE_ASSERTS=1 dmd +"$HOST_DC" -m$MODEL compiler/src/build.d -ofgenerated/build.exe +generated/build.exe -j$N MODEL=$MODEL HOST_DMD=$HOST_DC BUILD=debug "${disable_debug_for_unittests[@]}" unittest +generated/build.exe -j$N MODEL=$MODEL HOST_DMD=$HOST_DC DFLAGS="-L-LARGEADDRESSAWARE" ENABLE_RELEASE=1 ENABLE_ASSERTS=1 dmd -DMD_BIN_PATH="$DMD_DIR/generated/windows/release/$TOOL_MODEL/dmd.exe" +DMD_BIN_PATH="$DMD_DIR/generated/windows/release/$MODEL/dmd.exe" ################################################################################ # Build Druntime and Phobos @@ -100,11 +97,11 @@ if [ "${DMD_TEST_COVERAGE:-0}" = "1" ] ; then # Recompile debug dmd + unittests rm -rf "$DMD_DIR/generated/windows" - ../../generated/build.exe -j$N MODEL=$TOOL_MODEL DFLAGS="-L-LARGEADDRESSAWARE" ENABLE_DEBUG=1 ENABLE_COVERAGE=1 dmd - ../../generated/build.exe -j$N MODEL=$TOOL_MODEL DFLAGS="-L-LARGEADDRESSAWARE" ENABLE_DEBUG=1 ENABLE_COVERAGE=1 unittest + ../../generated/build.exe -j$N MODEL=$MODEL DFLAGS="-L-LARGEADDRESSAWARE" ENABLE_DEBUG=1 ENABLE_COVERAGE=1 dmd + ../../generated/build.exe -j$N MODEL=$MODEL DFLAGS="-L-LARGEADDRESSAWARE" ENABLE_DEBUG=1 ENABLE_COVERAGE=1 unittest fi -"$HOST_DC" -m$TOOL_MODEL -g -i run.d +"$HOST_DC" -m$MODEL -g -i run.d targets=("all") args=('ARGS=-O -inline -g') # no -release for faster builds diff --git a/compiler/src/dmd/link.d b/compiler/src/dmd/link.d index 669168e79673..7cf9fc601679 100644 --- a/compiler/src/dmd/link.d +++ b/compiler/src/dmd/link.d @@ -953,12 +953,6 @@ public int runPreprocessor(ref const Loc loc, const(char)[] cpp, const(char)[] f { //printf("runPreprocessor() cpp: %.*s filename: %.*s\n", cast(int)cpp.length, cpp.ptr, cast(int)filename.length, filename.ptr); - /* - To get sppn.exe: http://ftp.digitalmars.com/sppn.zip - To get the dmc C headers, dmc will need to be installed: - http://ftp.digitalmars.com/Digital_Mars_C++/Patch/dm857c.zip - */ - version (Windows) { // generate unique temporary file name for preprocessed output diff --git a/compiler/test/README.md b/compiler/test/README.md index 6d1f6e010698..75855a35aac7 100644 --- a/compiler/test/README.md +++ b/compiler/test/README.md @@ -356,7 +356,7 @@ Environment variables ARGS: set to execute all combinations of AUTO_UPDATE: set to 1 to auto-update mismatching test output - CC: C++ compiler to use, ex: dmc, g++ + CC: C++ compiler to use, ex: cl, g++ DMD: compiler to use, ex: ../src/dmd (required) MODEL: 32 or 64 (required) OS: windows, linux, freebsd, osx, netbsd, dragonflybsd diff --git a/compiler/test/compilable/stdcheaders.c b/compiler/test/compilable/stdcheaders.c index 07fbb73cdc4e..03690ea32091 100644 --- a/compiler/test/compilable/stdcheaders.c +++ b/compiler/test/compilable/stdcheaders.c @@ -4,9 +4,7 @@ #include -#ifndef __DMC__ // D:\a\1\s\tools\dm\include\complex.h(105): Deprecation: use of complex type `cdouble` is deprecated, use `std.complex.Complex!(double)` instead #include -#endif #include #include @@ -34,13 +32,10 @@ float x = NAN; #include #endif -#ifndef __DMC__ // no stdalign.h #include -#endif #include -#ifndef __DMC__ // no stdatomic.h #ifndef __linux__ #ifndef _MSC_VER #ifndef __APPLE__ // /Applications/Xcode-14.2.0.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/14.0.0/include/stdatomic.h(80): Error: type-specifier is missing @@ -48,7 +43,6 @@ float x = NAN; #endif #endif #endif -#endif #include #include @@ -59,13 +53,10 @@ float x = NAN; #include #endif -#ifndef __DMC__ // no stdnoreturn.h #include -#endif #include -#ifndef __DMC__ // no tgmath.h #ifndef _MSC_VER // C:\Program Files (x86)\Windows Kits\10\include\10.0.22621.0\ucrt\tgmath.h(33): Error: no type for declarator before `)` #ifndef __APPLE__ // /Applications/Xcode-14.2.0.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/tgmath.h(39): Error: named parameter required before `...` #if !(defined(__linux__) && defined(__aarch64__)) // /tmp/clang/lib/clang/15.0.3/include/tgmath.h(34): Error: named parameter required before `...` @@ -73,9 +64,7 @@ float x = NAN; #endif #endif #endif -#endif -#ifndef __DMC__ #ifndef __linux__ #ifndef __APPLE__ #ifndef _MSC_VER @@ -83,18 +72,13 @@ float x = NAN; #endif #endif #endif -#endif #include -#ifndef __DMC__ // no uchar.h #ifndef __APPLE__ // no uchar.h #include #endif -#endif #include -#ifndef __DMC__ // wctype.h(102): Error: unterminated string constant starting at #defines(780) #include -#endif diff --git a/compiler/test/dshell/cpp_header_gen.d b/compiler/test/dshell/cpp_header_gen.d index b05ed4141bf3..d0ec226a5403 100644 --- a/compiler/test/dshell/cpp_header_gen.d +++ b/compiler/test/dshell/cpp_header_gen.d @@ -9,16 +9,6 @@ int main() writeln("CPP header generation test was skipped because $CXX is empty!"); return DISABLED; } - // DMC cannot compile the generated headers ... - version (Windows) - { - import std.algorithm : canFind; - if (CXX.canFind("dmc")) - { - writeln("CPP header generation test was skipped because DMC is not supported!"); - return DISABLED; - } - } Vars.set("SOURCE_DIR", "$EXTRA_FILES/cpp_header_gen"); Vars.set("LIB", "$OUTPUT_BASE/library$LIBEXT"); diff --git a/compiler/test/runnable_cxx/extra-files/cpp7925.cpp b/compiler/test/runnable_cxx/extra-files/cpp7925.cpp index f3a9a8552a94..282faec797aa 100644 --- a/compiler/test/runnable_cxx/extra-files/cpp7925.cpp +++ b/compiler/test/runnable_cxx/extra-files/cpp7925.cpp @@ -90,14 +90,10 @@ void runCPPTests() int (C2::*fp1)(int) = &C2::f1; int (C2::*fp2)(int, int) = &C2::f2; int (C2::*fp3)(int, int) = &C2::f3; -#ifndef __DMC__ int (C2::*fp4)(int, ...) = &C2::f4; -#endif assert((c2->*(fp0))() == 100); assert((c2->*(fp1))(1) == 101); assert((c2->*(fp2))(20, 3) == 123); assert((c2->*(fp3))(20, 3) == 123); -#ifndef __DMC__ assert((c2->*(fp4))(20, 3, 0) == 123); -#endif } diff --git a/compiler/test/runnable_cxx/extra-files/cpp_abi_tests.cpp b/compiler/test/runnable_cxx/extra-files/cpp_abi_tests.cpp index e1dcc28b8b1d..cbde23378f2b 100644 --- a/compiler/test/runnable_cxx/extra-files/cpp_abi_tests.cpp +++ b/compiler/test/runnable_cxx/extra-files/cpp_abi_tests.cpp @@ -10,9 +10,7 @@ namespace std struct test19248 {int a;}; }; -#ifdef __DMC__ -// DMC doesn't support c++11 -#elif defined (_MSC_VER) && _MSC_VER <= 1800 +#if defined (_MSC_VER) && _MSC_VER <= 1800 // MSVC2013 doesn't support char16_t/char32_t #else #define TEST_UNICODE @@ -26,11 +24,7 @@ struct S18784 S18784::S18784(int n) : i(n) {} -#ifdef __DMC__ // DMC doesn't support c++11 -template -#else template -#endif struct SPack { int i; diff --git a/compiler/test/runnable_cxx/extra-files/cppb.cpp b/compiler/test/runnable_cxx/extra-files/cppb.cpp index 83667cbddc78..f91dfe8fb33f 100644 --- a/compiler/test/runnable_cxx/extra-files/cppb.cpp +++ b/compiler/test/runnable_cxx/extra-files/cppb.cpp @@ -374,9 +374,7 @@ wchar_t f13289_cpp_wchar_t(wchar_t ch) return ch; } } -#ifdef __DMC__ -// DMC doesn't support c++11 -#elif defined (_MSC_VER) //&& _MSC_VER <= 1800 +#if defined (_MSC_VER) //&& _MSC_VER <= 1800 // MSVC2013 doesn't support char16_t/char32_t #else #define TEST_UNICODE diff --git a/compiler/test/runnable_cxx/extra-files/externmangle.cpp b/compiler/test/runnable_cxx/extra-files/externmangle.cpp index 37c98ea8fdd3..df10a9cd88c5 100644 --- a/compiler/test/runnable_cxx/extra-files/externmangle.cpp +++ b/compiler/test/runnable_cxx/extra-files/externmangle.cpp @@ -426,7 +426,6 @@ namespace foo } } -#ifndef __DMC__ // DMC doesn't support c++11 template void foovargs(T... args); void test40() @@ -446,4 +445,3 @@ void test41() make_shared_poc(a, b); } -#endif diff --git a/compiler/test/runnable_cxx/extra-files/test20652.cpp b/compiler/test/runnable_cxx/extra-files/test20652.cpp index 91ab66aaf191..b35b3f51b150 100644 --- a/compiler/test/runnable_cxx/extra-files/test20652.cpp +++ b/compiler/test/runnable_cxx/extra-files/test20652.cpp @@ -1,6 +1,3 @@ -#if defined(__DMC__) // DMC doesn't support immintrin.h -#else - #include // Inline the typedef of __m128 instead of including immintrin.h. @@ -30,5 +27,3 @@ void test20652(const __m128& a) assert(b.array[2] == 1); assert(b.array[3] == 1); } - -#endif diff --git a/compiler/test/tools/d_do_test.d b/compiler/test/tools/d_do_test.d index 642b9d890e1b..8d7b7a641036 100755 --- a/compiler/test/tools/d_do_test.d +++ b/compiler/test/tools/d_do_test.d @@ -60,8 +60,8 @@ void usage() ~ " ARGS: set to execute all combinations of\n" ~ " REQUIRED_ARGS: arguments always passed to the compiler\n" ~ " DMD: compiler to use, ex: ../src/dmd (required)\n" - ~ " CC: C compiler to use, ex: dmc, cc\n" - ~ " CXX: C++ compiler to use, ex: dmc, g++\n" + ~ " CC: C compiler to use, ex: cl, cc\n" + ~ " CXX: C++ compiler to use, ex: cl, g++\n" ~ " OS: windows, linux, freebsd, osx, netbsd, dragonflybsd\n" ~ " RESULTS_DIR: base directory for test results\n" ~ " MODEL: 32 or 64 (required)\n" diff --git a/compiler/test/tools/exported_vars.sh b/compiler/test/tools/exported_vars.sh index 3e039b3c6e79..415b9632a8a7 100644 --- a/compiler/test/tools/exported_vars.sh +++ b/compiler/test/tools/exported_vars.sh @@ -36,8 +36,8 @@ else export SOEXT=.so fi -# Default to DigitalMars C++ on Win32 -if [ "$OS" == "win32" ] && [ -z "${CC+set}" ] ; then - CC="dmc" +# Default to Microsoft cl on Windows +if [[ "$OS" == "win"* && -z "${CC+set}" ]] ; then + CC="cl" fi export CC="${CC:-c++}" # C++ compiler to use diff --git a/druntime/src/rt/alloca.d b/druntime/src/rt/alloca.d index 28c205df6e29..cacf8c761429 100644 --- a/druntime/src/rt/alloca.d +++ b/druntime/src/rt/alloca.d @@ -11,20 +11,6 @@ module rt.alloca; -version (Posix) -{ - version = alloca; -} -else version (CRuntime_Microsoft) -{ - version = alloca; -} - -// Use DMC++'s alloca() for Win32 - -version (alloca) -{ - /******************************************* * Allocate data from the caller's stack frame. * This is a 'magic' function that needs help from the compiler to @@ -215,5 +201,3 @@ extern (C) void* __alloca(int nbytes) else static assert(0); } - -}