Skip to content

Commit 11621a5

Browse files
jeremyd2019mati865
andcommitted
[Clang][Cygwin] Enable few conditions that are shared with MinGW
Co-authored-by: Mateusz Mikuła <[email protected]>
1 parent c875bb8 commit 11621a5

File tree

6 files changed

+11
-11
lines changed

6 files changed

+11
-11
lines changed

clang/lib/AST/RecordLayoutBuilder.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1953,7 +1953,7 @@ void ItaniumRecordLayoutBuilder::LayoutField(const FieldDecl *D,
19531953
// silently there. For other targets that have ms_struct enabled
19541954
// (most probably via a pragma or attribute), trigger a diagnostic
19551955
// that defaults to an error.
1956-
if (!Context.getTargetInfo().getTriple().isWindowsGNUEnvironment())
1956+
if (!Context.getTargetInfo().getTriple().isOSCygMing())
19571957
Diag(D->getLocation(), diag::warn_npot_ms_struct);
19581958
}
19591959
if (TypeSize > FieldAlign &&

clang/lib/CIR/CodeGen/CIRGenModule.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1530,10 +1530,10 @@ static bool shouldAssumeDSOLocal(const CIRGenModule &cgm,
15301530

15311531
const llvm::Triple &tt = cgm.getTriple();
15321532
const CodeGenOptions &cgOpts = cgm.getCodeGenOpts();
1533-
if (tt.isWindowsGNUEnvironment()) {
1534-
// In MinGW, variables without DLLImport can still be automatically
1535-
// imported from a DLL by the linker; don't mark variables that
1536-
// potentially could come from another DLL as DSO local.
1533+
if (tt.isOSCygMing()) {
1534+
// In MinGW and Cygwin, variables without DLLImport can still be
1535+
// automatically imported from a DLL by the linker; don't mark variables
1536+
// that potentially could come from another DLL as DSO local.
15371537

15381538
// With EmulatedTLS, TLS variables can be autoimported from other DLLs
15391539
// (and this actually happens in the public interface of libstdc++), so

clang/lib/Driver/ToolChain.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -773,7 +773,7 @@ std::string ToolChain::buildCompilerRTBasename(const llvm::opt::ArgList &Args,
773773
break;
774774
case ToolChain::FT_Shared:
775775
if (TT.isOSWindows())
776-
Suffix = TT.isWindowsGNUEnvironment() ? ".dll.a" : ".lib";
776+
Suffix = TT.isOSCygMing() ? ".dll.a" : ".lib";
777777
else if (TT.isOSAIX())
778778
Suffix = ".a";
779779
else

clang/lib/Driver/ToolChains/Clang.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5965,7 +5965,7 @@ void Clang::ConstructJob(Compilation &C, const JobAction &JA,
59655965
CmdArgs.push_back("-mms-bitfields");
59665966
}
59675967

5968-
if (Triple.isWindowsGNUEnvironment()) {
5968+
if (Triple.isOSCygMing()) {
59695969
Args.addOptOutFlag(CmdArgs, options::OPT_fauto_import,
59705970
options::OPT_fno_auto_import);
59715971
}

clang/lib/Frontend/InitPreprocessor.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -945,8 +945,8 @@ static void InitializePredefinedMacros(const TargetInfo &TI,
945945
if (LangOpts.GNUCVersion && LangOpts.CPlusPlus11)
946946
Builder.defineMacro("__GXX_EXPERIMENTAL_CXX0X__");
947947

948-
if (TI.getTriple().isWindowsGNUEnvironment()) {
949-
// Set ABI defining macros for libstdc++ for MinGW, where the
948+
if (TI.getTriple().isOSCygMing()) {
949+
// Set ABI defining macros for libstdc++ for MinGW and Cygwin, where the
950950
// default in libstdc++ differs from the defaults for this target.
951951
Builder.defineMacro("__GXX_TYPEINFO_EQUALITY_INLINE", "0");
952952
}

clang/lib/Sema/SemaDecl.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12578,9 +12578,9 @@ static bool isDefaultStdCall(FunctionDecl *FD, Sema &S) {
1257812578
if (FD->getName() == "main" || FD->getName() == "wmain")
1257912579
return false;
1258012580

12581-
// Default calling convention for MinGW is __cdecl
12581+
// Default calling convention for MinGW and Cygwin is __cdecl
1258212582
const llvm::Triple &T = S.Context.getTargetInfo().getTriple();
12583-
if (T.isWindowsGNUEnvironment())
12583+
if (T.isOSCygMing())
1258412584
return false;
1258512585

1258612586
// Default calling convention for WinMain, wWinMain and DllMain

0 commit comments

Comments
 (0)