Skip to content

Commit 8fe057c

Browse files
committed
Adapt to renamed predefined CppRuntime_* versions
1 parent 3b16b38 commit 8fe057c

File tree

11 files changed

+44
-38
lines changed

11 files changed

+44
-38
lines changed

driver/main.cpp

+20-10
Original file line numberDiff line numberDiff line change
@@ -830,17 +830,20 @@ void registerPredefinedTargetVersions() {
830830
if (triple.getEnvironment() == llvm::Triple::Android) {
831831
VersionCondition::addPredefinedGlobalIdent("Android");
832832
VersionCondition::addPredefinedGlobalIdent("CRuntime_Bionic");
833-
VersionCondition::addPredefinedGlobalIdent("CppRuntime_Clang");
833+
VersionCondition::addPredefinedGlobalIdent("CppRuntime_LLVM");
834+
VersionCondition::addPredefinedGlobalIdent("CppRuntime_Clang"); // legacy
834835
} else if (triple.isMusl()) {
835836
VersionCondition::addPredefinedGlobalIdent("CRuntime_Musl");
836-
VersionCondition::addPredefinedGlobalIdent("CppRuntime_Gcc");
837+
VersionCondition::addPredefinedGlobalIdent("CppRuntime_GNU");
838+
VersionCondition::addPredefinedGlobalIdent("CppRuntime_Gcc"); // legacy
837839
// use libunwind for backtraces
838840
VersionCondition::addPredefinedGlobalIdent("DRuntime_Use_Libunwind");
839841
} else if (global.params.isUClibcEnvironment) {
840842
VersionCondition::addPredefinedGlobalIdent("CRuntime_UClibc");
841843
} else {
842844
VersionCondition::addPredefinedGlobalIdent("CRuntime_Glibc");
843-
VersionCondition::addPredefinedGlobalIdent("CppRuntime_Gcc");
845+
VersionCondition::addPredefinedGlobalIdent("CppRuntime_GNU");
846+
VersionCondition::addPredefinedGlobalIdent("CppRuntime_Gcc"); // legacy
844847
}
845848
break;
846849
case llvm::Triple::Haiku:
@@ -853,7 +856,8 @@ void registerPredefinedTargetVersions() {
853856
VersionCondition::addPredefinedGlobalIdent(
854857
"darwin"); // For backwards compatibility.
855858
VersionCondition::addPredefinedGlobalIdent("Posix");
856-
VersionCondition::addPredefinedGlobalIdent("CppRuntime_Clang");
859+
VersionCondition::addPredefinedGlobalIdent("CppRuntime_LLVM");
860+
VersionCondition::addPredefinedGlobalIdent("CppRuntime_Clang"); // legacy
857861
break;
858862
case llvm::Triple::FreeBSD:
859863
VersionCondition::addPredefinedGlobalIdent("FreeBSD");
@@ -864,7 +868,8 @@ void registerPredefinedTargetVersions() {
864868
warning(Loc(), "FreeBSD major version not specified in target triple");
865869
}
866870
VersionCondition::addPredefinedGlobalIdent("Posix");
867-
VersionCondition::addPredefinedGlobalIdent("CppRuntime_Clang");
871+
VersionCondition::addPredefinedGlobalIdent("CppRuntime_LLVM");
872+
VersionCondition::addPredefinedGlobalIdent("CppRuntime_Clang"); // legacy
868873
break;
869874
case llvm::Triple::Solaris:
870875
VersionCondition::addPredefinedGlobalIdent("Solaris");
@@ -874,7 +879,8 @@ void registerPredefinedTargetVersions() {
874879
case llvm::Triple::DragonFly:
875880
VersionCondition::addPredefinedGlobalIdent("DragonFlyBSD");
876881
VersionCondition::addPredefinedGlobalIdent("Posix");
877-
VersionCondition::addPredefinedGlobalIdent("CppRuntime_Gcc");
882+
VersionCondition::addPredefinedGlobalIdent("CppRuntime_GNU");
883+
VersionCondition::addPredefinedGlobalIdent("CppRuntime_Gcc"); // legacy
878884
break;
879885
case llvm::Triple::NetBSD:
880886
VersionCondition::addPredefinedGlobalIdent("NetBSD");
@@ -883,7 +889,8 @@ void registerPredefinedTargetVersions() {
883889
case llvm::Triple::OpenBSD:
884890
VersionCondition::addPredefinedGlobalIdent("OpenBSD");
885891
VersionCondition::addPredefinedGlobalIdent("Posix");
886-
VersionCondition::addPredefinedGlobalIdent("CppRuntime_Gcc");
892+
VersionCondition::addPredefinedGlobalIdent("CppRuntime_GNU");
893+
VersionCondition::addPredefinedGlobalIdent("CppRuntime_Gcc"); // legacy
887894
break;
888895
case llvm::Triple::AIX:
889896
VersionCondition::addPredefinedGlobalIdent("AIX");
@@ -892,17 +899,20 @@ void registerPredefinedTargetVersions() {
892899
case llvm::Triple::IOS:
893900
VersionCondition::addPredefinedGlobalIdent("iOS");
894901
VersionCondition::addPredefinedGlobalIdent("Posix");
895-
VersionCondition::addPredefinedGlobalIdent("CppRuntime_Clang");
902+
VersionCondition::addPredefinedGlobalIdent("CppRuntime_LLVM");
903+
VersionCondition::addPredefinedGlobalIdent("CppRuntime_Clang"); // legacy
896904
break;
897905
case llvm::Triple::TvOS:
898906
VersionCondition::addPredefinedGlobalIdent("TVOS");
899907
VersionCondition::addPredefinedGlobalIdent("Posix");
900-
VersionCondition::addPredefinedGlobalIdent("CppRuntime_Clang");
908+
VersionCondition::addPredefinedGlobalIdent("CppRuntime_LLVM");
909+
VersionCondition::addPredefinedGlobalIdent("CppRuntime_Clang"); // legacy
901910
break;
902911
case llvm::Triple::WatchOS:
903912
VersionCondition::addPredefinedGlobalIdent("WatchOS");
904913
VersionCondition::addPredefinedGlobalIdent("Posix");
905-
VersionCondition::addPredefinedGlobalIdent("CppRuntime_Clang");
914+
VersionCondition::addPredefinedGlobalIdent("CppRuntime_LLVM");
915+
VersionCondition::addPredefinedGlobalIdent("CppRuntime_Clang"); // legacy
906916
break;
907917
case llvm::Triple::WASI:
908918
VersionCondition::addPredefinedGlobalIdent("WASI");

runtime/druntime/src/core/stdcpp/allocator.d

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
module core.stdcpp.allocator;
1313

1414
// LDC: empty module for unsupported C++ runtimes
15-
version (CppRuntime_Microsoft) version = Supported;
16-
else version (CppRuntime_Gcc) version = Supported;
17-
else version (CppRuntime_Clang) version = Supported;
15+
version (CppRuntime_Microsoft) version = Supported;
16+
else version (CppRuntime_GNU) version = Supported;
17+
else version (CppRuntime_LLVM) version = Supported;
1818
version (Supported):
1919

2020
import core.stdcpp.new_;

runtime/druntime/src/core/stdcpp/array.d

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
module core.stdcpp.array;
1313

1414
// LDC: empty module for unsupported C++ runtimes
15-
version (CppRuntime_Microsoft) version = Supported;
16-
else version (CppRuntime_Gcc) version = Supported;
17-
else version (CppRuntime_Clang) version = Supported;
15+
version (CppRuntime_Microsoft) version = Supported;
16+
else version (CppRuntime_GNU) version = Supported;
17+
else version (CppRuntime_LLVM) version = Supported;
1818
version (Supported):
1919

2020
import core.stdcpp.xutility : StdNamespace;

runtime/druntime/src/core/stdcpp/exception.d

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
module core.stdcpp.exception;
1414

1515
// LDC: empty module for unsupported C++ runtimes
16-
version (CppRuntime_Microsoft) version = Supported;
17-
else version (CppRuntime_Gcc) version = Supported;
18-
else version (CppRuntime_Clang) version = Supported;
16+
version (CppRuntime_Microsoft) version = Supported;
17+
else version (CppRuntime_GNU) version = Supported;
18+
else version (CppRuntime_LLVM) version = Supported;
1919
version (Supported):
2020

2121
import core.stdcpp.xutility : __cplusplus, CppStdRevision;

runtime/druntime/src/core/stdcpp/memory.d

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
module core.stdcpp.memory;
1313

1414
// LDC: empty module for unsupported C++ runtimes
15-
version (CppRuntime_Microsoft) version = Supported;
16-
else version (CppRuntime_Gcc) version = Supported;
17-
else version (CppRuntime_Clang) version = Supported;
15+
version (CppRuntime_Microsoft) version = Supported;
16+
else version (CppRuntime_GNU) version = Supported;
17+
else version (CppRuntime_LLVM) version = Supported;
1818
version (Supported):
1919

2020
public import core.stdcpp.allocator;

runtime/druntime/src/core/stdcpp/new_.d

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
module core.stdcpp.new_;
1313

1414
// LDC: empty module for unsupported C++ runtimes
15-
version (CppRuntime_Microsoft) version = Supported;
16-
else version (CppRuntime_Gcc) version = Supported;
17-
else version (CppRuntime_Clang) version = Supported;
15+
version (CppRuntime_Microsoft) version = Supported;
16+
else version (CppRuntime_GNU) version = Supported;
17+
else version (CppRuntime_LLVM) version = Supported;
1818
version (Supported):
1919

2020
import core.stdcpp.xutility : __cpp_sized_deallocation, __cpp_aligned_new;

runtime/druntime/src/core/stdcpp/string.d

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
module core.stdcpp.string;
1414

1515
// LDC: empty module for unsupported C++ runtimes
16-
version (CppRuntime_Microsoft) version = Supported;
17-
else version (CppRuntime_Gcc) version = Supported;
18-
else version (CppRuntime_Clang) version = Supported;
16+
version (CppRuntime_Microsoft) version = Supported;
17+
else version (CppRuntime_GNU) version = Supported;
18+
else version (CppRuntime_LLVM) version = Supported;
1919
version (Supported):
2020

2121
import core.stdcpp.allocator;

runtime/druntime/src/core/stdcpp/string_view.d

+3-3
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
module core.stdcpp.string_view;
1313

1414
// LDC: empty module for unsupported C++ runtimes
15-
version (CppRuntime_Microsoft) version = Supported;
16-
else version (CppRuntime_Gcc) version = Supported;
17-
else version (CppRuntime_Clang) version = Supported;
15+
version (CppRuntime_Microsoft) version = Supported;
16+
else version (CppRuntime_GNU) version = Supported;
17+
else version (CppRuntime_LLVM) version = Supported;
1818
version (Supported):
1919

2020
import core.stdc.stddef : wchar_t;

runtime/druntime/src/rt/dwarfeh.d

+2-2
Original file line numberDiff line numberDiff line change
@@ -1210,7 +1210,7 @@ int actionTableLookup(_Unwind_Exception* exceptionObject, uint actionRecordPtr,
12101210
ClassInfo ci = cast(ClassInfo)cast(void*)(entry);
12111211
if (typeid(ci) is typeid(__cpp_type_info_ptr))
12121212
{
1213-
version (CppRuntime_Gcc)
1213+
version (CppRuntime_GNU)
12141214
{
12151215
if (exceptionClass == cppExceptionClass || exceptionClass == cppExceptionClass1)
12161216
{
@@ -1256,7 +1256,7 @@ void terminate(uint line) @nogc
12561256

12571257
/****************************** C++ Support *****************************/
12581258

1259-
version (CppRuntime_Gcc)
1259+
version (CppRuntime_GNU)
12601260
{
12611261
enum _Unwind_Exception_Class cppExceptionClass =
12621262
(cast(_Unwind_Exception_Class)'G' << 56) |

tests/dmd/runnable_cxx/cppa.d

+1-1
Original file line numberDiff line numberDiff line change
@@ -949,7 +949,7 @@ version (LDC)
949949
{
950950
version (CRuntime_Microsoft)
951951
version = LDC_CppEH;
952-
else version (CppRuntime_Gcc)
952+
else version (CppRuntime_GNU)
953953
version = LDC_CppEH;
954954
// FIXME: support libc++ too
955955
}

tests/dmd/tools/d_do_test.d

-4
Original file line numberDiff line numberDiff line change
@@ -220,10 +220,6 @@ immutable(EnvData) processEnvironment()
220220
envData.cxxCompatFlags = " -L-lstdc++ -L--no-demangle";
221221
else version (CppRuntime_LLVM)
222222
envData.cxxCompatFlags = " -L-lc++ -L--no-demangle";
223-
else version (CppRuntime_Gcc)
224-
envData.cxxCompatFlags = " -L-lstdc++ -L--no-demangle";
225-
else version (CppRuntime_Clang)
226-
envData.cxxCompatFlags = " -L-lc++ -L--no-demangle";
227223
break;
228224

229225
case "gdc":

0 commit comments

Comments
 (0)