|
| 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 | + |
0 commit comments