Skip to content

Commit 32fb1dc

Browse files
committed
flang: inherit target specific code for BIND(C) on Windows
1 parent 7f1b738 commit 32fb1dc

File tree

2 files changed

+54
-1
lines changed

2 files changed

+54
-1
lines changed
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
From afd990ed84c308d5d4d06f461d6bf80b670ddf16 Mon Sep 17 00:00:00 2001
2+
From: =?UTF-8?q?Markus=20M=C3=BCtzel?= <[email protected]>
3+
Date: Mon, 3 Mar 2025 10:32:22 +0100
4+
Subject: [PATCH] [flang] Inherit target specific code for BIND(C) types on
5+
Windows (#114035)
6+
7+
Inherit target specific code for Windows i386 and x86_64 from the classes that
8+
define that code for the respective processors on non-Windows operating
9+
systems.
10+
Only overload parts that differ.
11+
12+
That allows re-using the existing implementation for BIND(C) types on
13+
non-Windows x86_64 also for Windows x86_64 targets.
14+
---
15+
lib/Optimizer/CodeGen/Target.cpp | 12 ++++--------
16+
1 file changed, 4 insertions(+), 8 deletions(-)
17+
18+
diff --git a/lib/Optimizer/CodeGen/Target.cpp b/lib/Optimizer/CodeGen/Target.cpp
19+
index 2a1eb0bc33f5..b03c1dd492ab 100644
20+
--- a/lib/Optimizer/CodeGen/Target.cpp
21+
+++ b/lib/Optimizer/CodeGen/Target.cpp
22+
@@ -199,10 +199,8 @@ struct TargetI386 : public GenericTarget<TargetI386> {
23+
//===----------------------------------------------------------------------===//
24+
25+
namespace {
26+
-struct TargetI386Win : public GenericTarget<TargetI386Win> {
27+
- using GenericTarget::GenericTarget;
28+
-
29+
- static constexpr int defaultWidth = 32;
30+
+struct TargetI386Win : public TargetI386 {
31+
+ using TargetI386::TargetI386;
32+
33+
CodeGenSpecifics::Marshalling
34+
complexArgumentType(mlir::Location loc, mlir::Type eleTy) const override {
35+
@@ -718,10 +716,8 @@ struct TargetX86_64 : public GenericTarget<TargetX86_64> {
36+
//===----------------------------------------------------------------------===//
37+
38+
namespace {
39+
-struct TargetX86_64Win : public GenericTarget<TargetX86_64Win> {
40+
- using GenericTarget::GenericTarget;
41+
-
42+
- static constexpr int defaultWidth = 64;
43+
+struct TargetX86_64Win : public TargetX86_64 {
44+
+ using TargetX86_64::TargetX86_64;
45+
46+
CodeGenSpecifics::Marshalling
47+
complexArgumentType(mlir::Location loc, mlir::Type eleTy) const override {
48+
--
49+
2.47.1.windows.2
50+

mingw-w64-flang/PKGBUILD

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ _version=19.1.7
99
_rc=""
1010
_tag=llvmorg-${_version}${_rc}
1111
pkgver=${_version}${_rc/-/}
12-
pkgrel=1
12+
pkgrel=2
1313
pkgdesc="Fortran frontend for LLVM (mingw-w64)"
1414
arch=('any')
1515
mingw_arch=('ucrt64' 'clang64' 'clangarm64')
@@ -41,6 +41,7 @@ source=("${_url}/${_pkgfn}.tar.xz"{,.sig}
4141
"${_url}/cmake-${pkgver}.src.tar.xz"{,.sig}
4242
"0001-fold-double-bessel-functions-on-windows.patch"
4343
"0002-cmake-22162.patch"
44+
"0003-flang-Inherit-target-specific-code-for-BIND-C-types.patch"
4445
"0004-do-not-define-pid_t-on-mingw.patch"
4546
"0005-Fix-c_long_double-value-on-mingw-aarch64.patch"
4647
"0006-Rename-flang-new-flang-experimental-exec-to-flang.patch"
@@ -52,6 +53,7 @@ sha256sums=('632d598e990500c021a47b4f981efd39518d363b03d99da5ba4c1b14d838c40b'
5253
'SKIP'
5354
'ae666c454909f6695bcd69f067b9c5abf8a6e82ce2930955b8598ab3b58a5204'
5455
'77fb0612217b6af7a122f586a9d0d334cd48bb201509bf72e8f8e6244616e895'
56+
'bb7336e461a09d4af29cde2fd32081c8fcca7f93e9f9b6779eb074b3780fd002'
5557
'90bec8f2a9a8d62b57959722f3b15a54dfdaf24e0a5ea884bf6b1288d0853be8'
5658
'a1811227e2a26c2786b0c8577528580e679111f6c0889afea57d08333e2d5e4f'
5759
'f1b7a186e4890a67adc8e56800c7a91e72f04f14df3db20d7bcf7eaa149aa567'
@@ -77,6 +79,7 @@ prepare() {
7779
apply_patch_with_msg \
7880
"0001-fold-double-bessel-functions-on-windows.patch" \
7981
"0002-cmake-22162.patch" \
82+
"0003-flang-Inherit-target-specific-code-for-BIND-C-types.patch" \
8083
"0004-do-not-define-pid_t-on-mingw.patch" \
8184
"0005-Fix-c_long_double-value-on-mingw-aarch64.patch" \
8285
"0007-add-municode-flag-on-mingw.patch" \

0 commit comments

Comments
 (0)