llvm 3.5.2
[git/cygwin-packages/llvm3.5.git] / 3.5.1-cygwin-clang.patch
CommitLineData
789e4eb0
YS
1--- origsrc/llvm-3.5.1.src/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp 2014-07-17 11:27:40.000000000 -0500
2+++ src/llvm-3.5.1.src/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.cpp 2015-04-30 23:57:03.440469200 -0500
3@@ -340,7 +340,8 @@ static MCCodeGenInfo *createX86MCCodeGen
4
5 // For static codegen, if we're not already set, use Small codegen.
6 if (CM == CodeModel::Default)
7- CM = CodeModel::Small;
8+ CM = T.isWindowsCygwinEnvironment() && is64Bit ? CodeModel::Medium
9+ : CodeModel::Small;
10 else if (CM == CodeModel::JITDefault)
11 // 64-bit JIT places everything in the same buffer except external funcs.
12 CM = is64Bit ? CodeModel::Large : CodeModel::Small;
13--- origsrc/llvm-3.5.1.src/tools/clang/lib/Basic/Targets.cpp 2014-08-08 17:59:37.000000000 -0500
14+++ src/llvm-3.5.1.src/tools/clang/lib/Basic/Targets.cpp 2015-05-01 00:03:14.734617600 -0500
15@@ -3203,6 +3203,7 @@ public:
16 Builder.defineMacro("_X86_");
17 Builder.defineMacro("__CYGWIN__");
18 Builder.defineMacro("__CYGWIN32__");
19+ Builder.defineMacro("__declspec(a)", "__attribute__((a))");
20 DefineStd(Builder, "unix", Opts);
21 if (Opts.CPlusPlus)
22 Builder.defineMacro("_GNU_SOURCE");
23@@ -3409,6 +3410,35 @@ public:
24 } // end anonymous namespace
25
26 namespace {
27+// x86-64 Cygwin target
28+class CygwinX86_64TargetInfo : public X86_64TargetInfo {
29+public:
30+ CygwinX86_64TargetInfo(const llvm::Triple &Triple)
31+ : X86_64TargetInfo(Triple) {
32+ TLSSupported = false;
33+ WCharType = UnsignedShort;
34+ }
35+ virtual void getTargetDefines(const LangOptions &Opts,
36+ MacroBuilder &Builder) const {
37+ X86_64TargetInfo::getTargetDefines(Opts, Builder);
38+ Builder.defineMacro("__CYGWIN__");
39+ Builder.defineMacro("__declspec(a)", "__attribute__((a))");
40+ DefineStd(Builder, "unix", Opts);
41+ if (Opts.CPlusPlus)
42+ Builder.defineMacro("_GNU_SOURCE");
43+ }
44+ virtual BuiltinVaListKind getBuiltinVaListKind() const {
45+ return TargetInfo::CharPtrBuiltinVaList;
46+ }
47+ virtual CallingConvCheckResult checkCallingConvention(CallingConv CC) const {
48+ return (CC == CC_C ||
49+ CC == CC_IntelOclBicc ||
50+ CC == CC_X86_64SysV) ? CCCR_OK : CCCR_Warning;
51+ }
52+};
53+} // end anonymous namespace
54+
55+namespace {
56 class DarwinX86_64TargetInfo : public DarwinTargetInfo<X86_64TargetInfo> {
57 public:
58 DarwinX86_64TargetInfo(const llvm::Triple &Triple)
59@@ -6357,6 +6387,8 @@ static TargetInfo *AllocateTarget(const
60 switch (Triple.getEnvironment()) {
61 default:
62 return new X86_64TargetInfo(Triple);
63+ case llvm::Triple::Cygnus:
64+ return new CygwinX86_64TargetInfo(Triple);
65 case llvm::Triple::GNU:
66 return new MinGWX86_64TargetInfo(Triple);
67 case llvm::Triple::MSVC:
68--- origsrc/llvm-3.5.1.src/tools/clang/lib/Driver/Tools.cpp 2014-08-06 23:51:51.000000000 -0500
69+++ src/llvm-3.5.1.src/tools/clang/lib/Driver/Tools.cpp 2015-05-01 00:00:53.669704600 -0500
70@@ -3887,7 +3887,7 @@ void Clang::ConstructJob(Compilation &C,
71 // -fuse-cxa-atexit is default.
72 if (!Args.hasFlag(options::OPT_fuse_cxa_atexit,
73 options::OPT_fno_use_cxa_atexit,
74- !IsWindowsCygnus && !IsWindowsGNU &&
75+ !IsWindowsGNU &&
76 getToolChain().getArch() != llvm::Triple::hexagon &&
77 getToolChain().getArch() != llvm::Triple::xcore) ||
78 KernelOrKext)
79--- origsrc/llvm-3.5.1.src/tools/clang/lib/Frontend/InitHeaderSearch.cpp 2014-06-10 16:07:12.000000000 -0500
80+++ src/llvm-3.5.1.src/tools/clang/lib/Frontend/InitHeaderSearch.cpp 2015-05-01 00:05:18.171792100 -0500
81@@ -395,14 +395,13 @@ AddDefaultCPlusPlusIncludePaths(const ll
82 case llvm::Triple::Win32:
83 switch (triple.getEnvironment()) {
84 default: llvm_unreachable("Include management is handled in the driver.");
85- case llvm::Triple::Cygnus:
86- // Cygwin-1.7
87- AddMinGWCPlusPlusIncludePaths("/usr/lib/gcc", "i686-pc-cygwin", "4.7.3");
88- AddMinGWCPlusPlusIncludePaths("/usr/lib/gcc", "i686-pc-cygwin", "4.5.3");
89- AddMinGWCPlusPlusIncludePaths("/usr/lib/gcc", "i686-pc-cygwin", "4.3.4");
90- // g++-4 / Cygwin-1.5
91- AddMinGWCPlusPlusIncludePaths("/usr/lib/gcc", "i686-pc-cygwin", "4.3.2");
92+ case llvm::Triple::Cygnus: {
93+ std::string arch = triple.getArch() == llvm::Triple::x86_64 ? "x86_64" : "i686";
94+ AddMinGWCPlusPlusIncludePaths("/usr/lib/gcc", arch + "-pc-cygwin", "4.9.3");
95+ AddMinGWCPlusPlusIncludePaths("/usr/lib/gcc", arch + "-pc-cygwin", "4.9.2");
96+ AddMinGWCPlusPlusIncludePaths("/usr/lib/gcc", arch + "-pc-cygwin", "4.8.3");
97 break;
98+ }
99 case llvm::Triple::GNU:
100 // mingw-w64 C++ include paths (i686-w64-mingw32 and x86_64-w64-mingw32)
101 AddMinGW64CXXPaths(HSOpts.ResourceDir, "4.7.0");
This page took 0.026732 seconds and 5 git commands to generate.