[flang-commits] [flang] [flang] remove sequences of duplicate messages (PR #161916)

Eugene Epshteyn via flang-commits flang-commits at lists.llvm.org
Fri Oct 3 15:11:19 PDT 2025


================
@@ -477,15 +477,31 @@ void Messages::Emit(llvm::raw_ostream &o, const AllCookedSources &allCooked,
   }
   std::stable_sort(sorted.begin(), sorted.end(),
       [](const Message *x, const Message *y) { return x->SortBefore(*y); });
-  const Message *lastMsg{nullptr};
+  std::vector<const Message *> msgsWithLastLocation;
----------------
eugeneepshteyn wrote:

Just a thought: would it be perhaps possible to use a data structure for messages that provides uniqueness and sorting? Like `std::set`?

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


More information about the flang-commits mailing list