================
@@ -858,11 +858,21 @@ void 
CheckerManager::runCheckersForPrintStateJson(raw_ostream &Out,
   ++Space;
   bool HasMessage = false;
 
-  // Store the last CheckerTag.
-  const void *LastCT = nullptr;
+  std::vector<CheckerBackend *> CheckerBackends;
   for (const auto &CT : CheckerTags) {
+    CheckerBackend *CB = CT.second.get();
+    CheckerBackends.push_back(CB);
+  }
+  llvm::sort(CheckerBackends,
+             [](const CheckerBackend *First, const CheckerBackend *Last) {
+               return First->getDebugTag() < Last->getDebugTag();
----------------
NagyDonat wrote:

What is the reason for picking the variable names `First` and `Last` here? Is 
this some established pattern? If not, then I'd prefer some clearly meaningless 
names (e.g. `X` and `Y`), because these made me think if there is some meaning 
behind them.

https://github.com/llvm/llvm-project/pull/235091
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to