[flang-commits] [flang] [mlir] [flang][AIX] BIND(C) derived type alignment for AIX (PR #121505)
Peter Klausler via flang-commits
flang-commits at lists.llvm.org
Thu Jan 2 09:48:24 PST 2025
================
@@ -113,7 +172,15 @@ void ComputeOffsetsHelper::Compute(Scope &scope) {
if (!FindCommonBlockContaining(*symbol) &&
dependents_.find(symbol) == dependents_.end() &&
equivalenceBlock_.find(symbol) == equivalenceBlock_.end()) {
- DoSymbol(*symbol);
+
+ std::optional<size_t> newAlign{std::nullopt};
+ // Handle special alignment requirement for AIX
+ auto triple{llvm::Triple(
+ llvm::Triple::normalize(llvm::sys::getDefaultTargetTriple()))};
+ if (triple.getOS() == llvm::Triple::OSType::AIX) {
+ newAlign = HasSpecialAlign(*symbol, scope);
----------------
klausler wrote:
If your new functions are used only for AIX targets, please add comments to those functions to that effect to avoid confusion in the general case.
https://github.com/llvm/llvm-project/pull/121505
More information about the flang-commits
mailing list