[flang-commits] [PATCH] D88793: [flang] Fix assumptions on std::forward_list iterator implementation.

Peter Klausler via Phabricator via flang-commits flang-commits at lists.llvm.org
Mon Oct 5 11:19:34 PDT 2020


klausler added a comment.

In D88793#2310581 <https://reviews.llvm.org/D88793#2310581>, @Meinersbur wrote:

> There seems to be no good reason for this strategy. Possible other implementations:
>
> 1. Use of `std::deque` which all direct insertion at the end. It also does not require an heap allocation for every element inserted.
> 2. Use of `std::vector`. When emitting diagnostics, all elements are copied to a `std::vector` anyway.
> 3. Insertion and the beginning of `std::forward_list`. Again, the list is sorted anyway before messages are printed.

The point is to use `std::forward_list::splice_after()` for efficient combination of messages.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D88793



More information about the flang-commits mailing list