Skip to content

Commit afd990e

Browse files
committed
[flang] Inherit target specific code for BIND(C) types on Windows (#114035)
Inherit target specific code for Windows i386 and x86_64 from the classes that define that code for the respective processors on non-Windows operating systems. Only overload parts that differ. That allows re-using the existing implementation for BIND(C) types on non-Windows x86_64 also for Windows x86_64 targets.
1 parent 1891281 commit afd990e

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

flang/lib/Optimizer/CodeGen/Target.cpp

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,10 +199,8 @@ struct TargetI386 : public GenericTarget<TargetI386> {
199199
//===----------------------------------------------------------------------===//
200200

201201
namespace {
202-
struct TargetI386Win : public GenericTarget<TargetI386Win> {
203-
using GenericTarget::GenericTarget;
204-
205-
static constexpr int defaultWidth = 32;
202+
struct TargetI386Win : public TargetI386 {
203+
using TargetI386::TargetI386;
206204

207205
CodeGenSpecifics::Marshalling
208206
complexArgumentType(mlir::Location loc, mlir::Type eleTy) const override {
@@ -718,10 +716,8 @@ struct TargetX86_64 : public GenericTarget<TargetX86_64> {
718716
//===----------------------------------------------------------------------===//
719717

720718
namespace {
721-
struct TargetX86_64Win : public GenericTarget<TargetX86_64Win> {
722-
using GenericTarget::GenericTarget;
723-
724-
static constexpr int defaultWidth = 64;
719+
struct TargetX86_64Win : public TargetX86_64 {
720+
using TargetX86_64::TargetX86_64;
725721

726722
CodeGenSpecifics::Marshalling
727723
complexArgumentType(mlir::Location loc, mlir::Type eleTy) const override {

0 commit comments

Comments
 (0)