[PATCH] D97774: [flang] Detect circularly defined interfaces of procedures

Tim Keith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 3 15:24:08 PST 2021


tskeith added inline comments.


================
Comment at: flang/include/flang/Semantics/symbol.h:600
+    // For maps of symbols: collate them by source location
     return name_.begin() < that.name_.begin();
   }
----------------
I don't like keeping an `operator<` that is only valid in some cases. It took a long time to find the bug with `SymbolSet` and `errorSymbols_` and the presence of this function makes it easy to introduce another similar bug.

I think it would be better not to provide a default ordering of symbols, or to provide one that is always valid. Ordering by symbol address is valid, though may result in an unexpected order. Or we could add a serial number to symbols and sort them using that, i.e. in order of creation.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D97774



More information about the llvm-commits mailing list