[PATCH] D88313: [flang] Failed call to CHECK() for call to ASSOCIATED(NULL())

Pete Steinfeld via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Sep 25 12:03:45 PDT 2020


PeteSteinfeld added inline comments.


================
Comment at: flang/include/flang/Evaluate/characteristics.h:233
   static std::optional<DummyArgument> FromActual(
-      std::string &&, const Expr<SomeType> &, FoldingContext &);
+      std::string &&, const Expr<SomeType> &, FoldingContext &, bool);
   bool IsOptional() const;
----------------
klausler wrote:
> Magic flag arguments should be avoided.  If you want special-case handling of some input in some situation, consider adding a wrapper function with the magic that defaults to the original function otherwise.  But maybe the new special behavior doesn't have to be special -- what would break if you just changed the treatment of `NULL` for all cases?
Thanks, Peter.

My first impulse was to change the treatment of `NULL` for both cases, but that caused problems in the treatment of procedure arguments.  I'll take another look at this and see if I can make it work.  If not, I'll look at adding a wrapper function.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D88313/new/

https://reviews.llvm.org/D88313



More information about the llvm-commits mailing list