[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