[flang-commits] [flang] [flang] Represent use statement in fir. (PR #168106)

via flang-commits flang-commits at lists.llvm.org
Mon Dec 15 13:12:48 PST 2025


jeanPerier wrote:

> Hi @jeanPerier
> 
> Do you have any further comments on this PR?

Thanks for the explanations. I think the processing of the `parser::UseStmt`` should be moved into the PFT visitor (probably as a new else if constexpr case [here](https://github.com/llvm/llvm-project/blob/691b04d5a2a927b3e159508e1495da356ed98001/flang/lib/Lower/PFTBuilder.cpp#L127)), stored into the PFT funit, and the visit of the parser::Usetmt/building of the data structure should be limited to the cases where requested debug info is above `mlir::LLVM::DIEmissionKind::LineTablesOnly`.

I would still be inclined into not making it an operation and having it be an attribute or some module level info since it does not really need to be part of the IR that every pass has to visit, process and potentially clone, but I am OK with your approach that is already a good improvement, and the attribute is nicely written and could be attached somewhere else if needed this turned out to be a concern. Thanks for improving the IR and debug info here.

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


More information about the flang-commits mailing list