[PATCH] D145993: [-Wunsafe-buffer-usage] Reducing non-determinism in diagnostics output stream

Artem Dergachev via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 13 15:26:46 PDT 2023


NoQ accepted this revision.
NoQ added a comment.
This revision is now accepted and ready to land.

LGTM, let's land asap!



================
Comment at: clang/include/clang/Analysis/Analyses/UnsafeBufferUsage.h:65-71
+// Compares AST nodes by source locations.
+template <typename NodeTy> struct CompareNode {
+  bool operator()(const NodeTy *N1, const NodeTy *N2) const {
+    return N1->getBeginLoc().getRawEncoding() <
+           N2->getBeginLoc().getRawEncoding();
+  }
+};
----------------
Nice template solution!

Can we keep it in the `.cpp` file? It's not really part of our analysis's user interface, at least not yet.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D145993



More information about the cfe-commits mailing list