[PATCH] D135490: [clang/Sema] Follow-up for fix of non-deterministic order of `-Wunused-variable` diagnostic

Argyrios Kyrtzidis via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 10 11:37:15 PDT 2022


akyrtzi added a comment.

In D135490#3847454 <https://reviews.llvm.org/D135490#3847454>, @steven_wu wrote:

> I don't know too much about this. I guess have a DiagReceiver to force the emitting order is a good thing but it is kind of weird to have this just for unused warning.
>
> I am guessing my suspect of removing decl from the scope is the cause of the slow down. Maybe we just force order on iteration?

Ordering the decls every time `ActOnPopScope` is called is not cheap; ordering only the diagnostics (if any is emitted) is the most efficient way I could find.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D135490



More information about the cfe-commits mailing list