[flang-commits] [flang] [Flang] Add `INLINEALWAYS` Compiler Directive (PR #192674)

Tom Eccles via flang-commits flang-commits at lists.llvm.org
Mon Apr 20 03:26:07 PDT 2026


================
@@ -10371,6 +10371,21 @@ void ResolveNamesVisitor::Post(const parser::CompilerDirective &x) {
         }
       }
     }
+  } else if (const auto *inlineAlways{
+                 std::get_if<parser::CompilerDirective::InlineAlways>(&x.u)}) {
+    if (!inlineAlways->v.has_value()) {
+      return;
+    }
+
+    Symbol *sym{currScope().symbol()};
+    if (!sym || !sym->has<SubprogramDetails>()) {
+      Say(x.source,
+          "!DIR$ INLINEALWAYS directive with name must appear in a subroutine or function"_err_en_US);
+    }
+    if (inlineAlways->v->ToString() != sym->name().ToString()) {
+      context().Warn(common::UsageWarning::IgnoredDirective, x.source,
+          "IGNOREALWAYS function name does not match the function"_warn_en_US);
----------------
tblah wrote:

```suggestion
          "INLINEALWAYS function name does not match the function"_warn_en_US);
```

I wonder if there's a better word than "function" for use in fortran contexts. This applies to subroutines too. I see flang is using "subprogram" internally, does anyone know if that is language that users will understand?

https://github.com/llvm/llvm-project/pull/192674


More information about the flang-commits mailing list