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

Jack Styles via flang-commits flang-commits at lists.llvm.org
Mon Apr 27 00:53:23 PDT 2026


================
@@ -10495,6 +10495,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,
+          "INLINEALWAYS name does not match the subroutine or function name"_warn_en_US);
----------------
Stylie777 wrote:

I have also updated the message above this one so it also refers to `subprogram`'s instead of `subroutine or function`'s.

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


More information about the flang-commits mailing list