[flang-commits] [flang] [flang] Inherit target specific code for BIND(C) types on Windows (#114035) (PR #129579)
Markus Mützel via flang-commits
flang-commits at lists.llvm.org
Wed Mar 5 23:33:44 PST 2025
mmuetzel wrote:
> If there is no functional change, can you add NFC to the patch title?
Thank you for checking this PR.
While there is no functional change by this change for most target, there is one for Windows x86_64 targets.
Without this change, trying to use BIND(C) types targeting Windows x86_64 leads to a compilation error like the following with Flang (see #114035):
```
not yet implemented: passing VALUE BIND(C) derived type for this target
```
With this change, the existing implementation for x86_64 is also used when targeting Windows x86_64.
This is essentially a follow up on 774703ec. Back when I originally proposed those changes, the `TargetX86_64Win` and `TargetI386Win` classes provided implementations for the same set of member functions of the `TargetX86_64` and `TargetI386` classes, respectively.
Since then, a few more member functions have been added to `TargetX86_64`. There is no equivalent for these member functions in the `TargetX86_64Win` class now.
Instead of essentially copying most of the source code that already exists in the `TargetX86_64` class to the `TargetX86_64Win` class, I figured that it would make sense now to inherit from the `TargetX86_64` class instead and only keep overloads for the member functions that need to be different on Windows.
This change doesn't add any new implementation though. It just re-uses the existing implementation. Does that mean that NFC should still be added to the patch title?
In any case, this is the first time I'm trying to contribute to LLVM since it moved to PRs on GitHub. Please, let me know if I'm doing something wrong.
https://github.com/llvm/llvm-project/pull/129579
More information about the flang-commits
mailing list