Skip to content

Commit

Permalink
Get rid of obsolete DMC special cases
Browse files Browse the repository at this point in the history
  • Loading branch information
kinke committed May 25, 2024
1 parent 6d69608 commit 47771d4
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 99 deletions.
14 changes: 0 additions & 14 deletions .azure-pipelines/lib.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
################################################################################
Expand Down
17 changes: 7 additions & 10 deletions .azure-pipelines/windows.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down
6 changes: 0 additions & 6 deletions compiler/src/dmd/link.d
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion compiler/test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
16 changes: 0 additions & 16 deletions compiler/test/compilable/stdcheaders.c
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,7 @@

#include <assert.h>

#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 <complex.h>
#endif

#include <ctype.h>
#include <errno.h>
Expand Down Expand Up @@ -34,21 +32,17 @@ float x = NAN;
#include <signal.h>
#endif

#ifndef __DMC__ // no stdalign.h
#include <stdalign.h>
#endif

#include <stdarg.h>

#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
#include <stdatomic.h>
#endif
#endif
#endif
#endif

#include <stdbool.h>
#include <stddef.h>
Expand All @@ -59,42 +53,32 @@ float x = NAN;
#include <stdlib.h>
#endif

#ifndef __DMC__ // no stdnoreturn.h
#include <stdnoreturn.h>
#endif

#include <string.h>

#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 `...`
#include <tgmath.h>
#endif
#endif
#endif
#endif

#ifndef __DMC__
#ifndef __linux__
#ifndef __APPLE__
#ifndef _MSC_VER
#include <threads.h>
#endif
#endif
#endif
#endif

#include <time.h>

#ifndef __DMC__ // no uchar.h
#ifndef __APPLE__ // no uchar.h
#include <uchar.h>
#endif
#endif

#include <wchar.h>

#ifndef __DMC__ // wctype.h(102): Error: unterminated string constant starting at #defines(780)
#include <wctype.h>
#endif
10 changes: 0 additions & 10 deletions compiler/test/dshell/cpp_header_gen.d
Original file line number Diff line number Diff line change
Expand Up @@ -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");
Expand Down
4 changes: 0 additions & 4 deletions compiler/test/runnable_cxx/extra-files/cpp7925.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
8 changes: 1 addition & 7 deletions compiler/test/runnable_cxx/extra-files/cpp_abi_tests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -26,11 +24,7 @@ struct S18784

S18784::S18784(int n) : i(n) {}

#ifdef __DMC__ // DMC doesn't support c++11
template <class>
#else
template <class...>
#endif
struct SPack
{
int i;
Expand Down
4 changes: 1 addition & 3 deletions compiler/test/runnable_cxx/extra-files/cppb.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 0 additions & 2 deletions compiler/test/runnable_cxx/extra-files/externmangle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,6 @@ namespace foo
}
}

#ifndef __DMC__ // DMC doesn't support c++11
template<typename ...T> void foovargs(T... args);

void test40()
Expand All @@ -446,4 +445,3 @@ void test41()
make_shared_poc<int, int, int>(a, b);

}
#endif
5 changes: 0 additions & 5 deletions compiler/test/runnable_cxx/extra-files/test20652.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#if defined(__DMC__) // DMC doesn't support immintrin.h
#else

#include <assert.h>

// Inline the typedef of __m128 instead of including immintrin.h.
Expand Down Expand Up @@ -30,5 +27,3 @@ void test20652(const __m128& a)
assert(b.array[2] == 1);
assert(b.array[3] == 1);
}

#endif
4 changes: 2 additions & 2 deletions compiler/test/tools/d_do_test.d
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
6 changes: 3 additions & 3 deletions compiler/test/tools/exported_vars.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
16 changes: 0 additions & 16 deletions druntime/src/rt/alloca.d
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -215,5 +201,3 @@ extern (C) void* __alloca(int nbytes)
else
static assert(0);
}

}

0 comments on commit 47771d4

Please sign in to comment.