[clang/Sema] Follow-up for fix of non-deterministic order of `-Wunused-variable`...
authorArgyrios Kyrtzidis <kyrtzidis@apple.com>
Fri, 7 Oct 2022 20:51:00 +0000 (13:51 -0700)
committerArgyrios Kyrtzidis <kyrtzidis@apple.com>
Tue, 11 Oct 2022 20:39:26 +0000 (13:39 -0700)
commit0456acbfb942f127359a8defd1b4f1f44420df3e
tree4dcd87f2a91c472d098a7ac3ece25c0f42e1096d
parentc49cde6467f9bf200640db763152a9dc7f009520
[clang/Sema] Follow-up for fix of non-deterministic order of `-Wunused-variable` diagnostic

Commit `371883f46dc23f8464cbf578e2d12a4f92e61917` caused a noticeable compile-time regression (about 0.4% geomean at -O0):
http://llvm-compile-time-tracker.com/compare.php?from=92233159035d1b50face95d886901cf99035bd99&to=371883f46dc23f8464cbf578e2d12a4f92e61917&stat=instructions

To address this switch `Scope::DeclSetTy` back to a `SmallPtrSet` and change `Sema::ActOnPopScope` to explicitly order the diagnostics that this function emits.

Differential Revision: https://reviews.llvm.org/D135490
clang/include/clang/Sema/Scope.h
clang/include/clang/Sema/Sema.h
clang/lib/Sema/SemaDecl.cpp