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

Steven Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Oct 10 11:29:55 PDT 2022


steven_wu added a comment.

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?



================
Comment at: clang/include/clang/Sema/Scope.h:310
 
   decl_range decls() const {
     return decl_range(DeclsInScope.begin(), DeclsInScope.end());
----------------
I wonder if it would be easy if you just sort here and provide a consistent ordering when iterating?


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