[flang-commits] [flang] [flang] Compiler directives defined by plugins (PR #228757)

via flang-commits flang-commits at lists.llvm.org
Sat Oct 3 12:36:11 PDT 2026


github-actions[bot] wrote:

<!--LLVM CODE FORMAT COMMENT: {clang-format}-->


:warning: C/C++ code formatter, clang-format found issues in your code. :warning:

<details>
<summary>
You can test this locally with the following command:
</summary>

``````````bash
git-clang-format --diff origin/main HEAD --extensions h,cpp -- flang/examples/DirectivesPlugin/DirectivesPlugin.cpp flang/include/flang/Support/PluginDirectives.h flang/lib/Support/PluginDirectives.cpp flang/include/flang/Lower/ConvertVariable.h flang/include/flang/Parser/dump-parse-tree.h flang/include/flang/Parser/parse-tree.h flang/include/flang/Semantics/semantics.h flang/lib/Lower/Bridge.cpp flang/lib/Lower/ConvertVariable.cpp flang/lib/Parser/Fortran-parsers.cpp flang/lib/Parser/parsing.cpp flang/lib/Parser/prescan.cpp flang/lib/Parser/prescan.h flang/lib/Parser/unparse.cpp flang/lib/Semantics/mod-file.cpp flang/lib/Semantics/resolve-names.cpp --diff_from_common_commit
``````````

:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:

</details>

<details>
<summary>
View the diff from clang-format here.
</summary>

``````````diff
diff --git a/flang/lib/Lower/Bridge.cpp b/flang/lib/Lower/Bridge.cpp
index b8f23da29..6c84346e1 100644
--- a/flang/lib/Lower/Bridge.cpp
+++ b/flang/lib/Lower/Bridge.cpp
@@ -725,12 +725,12 @@ public:
       if (!isReferable(sym)) {
         return nullptr;
       }
-      if (mlir::Operation *op{module.lookupSymbol(mangleName(sym))}) {
+      if (mlir::Operation * op{module.lookupSymbol(mangleName(sym))}) {
         return op;
       }
       if (Fortran::semantics::IsProcedure(sym)) {
         return Fortran::lower::getOrDeclareFunction(
-            Fortran::evaluate::ProcedureDesignator{sym}, *this)
+                   Fortran::evaluate::ProcedureDesignator{sym}, *this)
             .getOperation();
       }
       if (sym.has<Fortran::semantics::ObjectEntityDetails>() &&
diff --git a/flang/lib/Semantics/resolve-names.cpp b/flang/lib/Semantics/resolve-names.cpp
index d1e0dbccc..a5b515a0e 100644
--- a/flang/lib/Semantics/resolve-names.cpp
+++ b/flang/lib/Semantics/resolve-names.cpp
@@ -11731,8 +11731,8 @@ void ResolveNamesVisitor::ResolvePluginDirective(
   }
   if (ok) {
     for (const Symbol *s : subjects) {
-      context().AddPluginDirective(*s, x,
-          currScope().symbol() && currScope().symbol()->IsFromModFile());
+      context().AddPluginDirective(
+          *s, x, currScope().symbol() && currScope().symbol()->IsFromModFile());
     }
   }
 }

``````````

</details>


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


More information about the flang-commits mailing list