[PATCH] D96631: [flang] Detect circularly defined procedures
Pete Steinfeld via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Fri Feb 12 14:15:36 PST 2021
PeteSteinfeld added inline comments.
================
Comment at: flang/include/flang/Evaluate/characteristics.h:211
static std::optional<DummyProcedure> Characterize(
- const semantics::Symbol &, FoldingContext &context);
+ const semantics::Symbol &, FoldingContext &context, SeenProcs &);
llvm::raw_ostream &Dump(llvm::raw_ostream &) const;
----------------
klausler wrote:
> As a convenience to external clients, this new argument could be either a pointer that default to nullptr, or there could be an overload without the set argument that declares one and passes it onward (my preference).
I'm not sure if I understand your comment. There are no external clients for the Characterize() functions for a DummyProcedure or a DummyArgument. Rather, all of the calls to them happen in .../Evaluate/characteristics.cpp. There are external clients for Procedure::Characterize(). For this function, I did as you recommend -- the version without the set argument creates one and passes it on to the overload that contains the set argument.
================
Comment at: flang/lib/Evaluate/characteristics.cpp:655
+ context.messages().Say(symbol.name(),
+ "Procedure '%s' depends on itself"_err_en_US, symbol.name());
+ return std::nullopt;
----------------
klausler wrote:
> Please clarify this message so that the user can tell that the circular dependence is in the specification of the procedure's interface or characteristics.
I'll take a crack at it.
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D96631/new/
https://reviews.llvm.org/D96631
More information about the llvm-commits
mailing list