steakhal added inline comments.

================
Comment at: clang/lib/StaticAnalyzer/Core/WorkList.cpp:204-207
   // Compare by number of times the location was visited first (negated
   // to prefer less often visited locations), then by insertion time (prefer
   // expanding nodes inserted sooner first).
+  using QueuePriority = std::pair<int, long>;
----------------
Please leave a note there, of what the negative values are used for.


================
Comment at: clang/lib/StaticAnalyzer/Core/WorkList.cpp:216-218
   // Number of inserted nodes, used to emulate DFS ordering in the priority
   // queue when insertions are equal.
+  long Counter = 0;
----------------
It seems like you are not exploiting the signedness of this variable. And a 
counter should never be negative anyway.


================
Comment at: clang/lib/StaticAnalyzer/Core/WorkList.cpp:255
+class CTUWorkList : public UnexploredFirstPriorityQueue {
+  enum class SecondaryOrder { DFS = 1, ReverseDFS };
+  SecondaryOrder ScndOrd = SecondaryOrder::ReverseDFS;
----------------
Raw enum would make it more convenient, and the scope is already private - thus 
it won't affect readability elsewhere.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D123784

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to