[flang-commits] [flang] [flang][OpenACC] Don't hoist declare directive out of interface bodies (PR #202806)

via flang-commits flang-commits at lists.llvm.org
Thu Jun 11 01:18:10 PDT 2026


================
@@ -335,6 +335,22 @@ class PFTBuilder {
   }
   void Post(const parser::SpecificationPart &) { --specificationPartLevel; }
 
+  // Interface bodies are not lowered, so their declarative constructs must not
+  // be added to the enclosing program unit's evaluation list.
----------------
jeanPerier wrote:

Nit: these comments are not really useful here. Only the comment near `Pre(const parser::OpenACCDeclarativeConstruct &accDecl)`.

Near `Pre(const parser::InterfaceBody &) `, the code is just keeping track of the nesting inside InterfaceBody and the comment is not needed. The code is simple and best speaks for itself.

AI assistants tends to add too much comments, if you are using one, I would suggest asking it to prune the comments/only add them where relevant.

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


More information about the flang-commits mailing list