[PATCH] D35039: [llvm-pdbutil] Improve output of llvm-pdbutil diff mode

Reid Kleckner via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jul 7 10:03:57 PDT 2017


rnk added inline comments.


================
Comment at: llvm/tools/llvm-pdbutil/DiffPrinter.cpp:1
+
+#include "DiffPrinter.h"
----------------
Add the annoying LLVM banner for consistency.


================
Comment at: llvm/tools/llvm-pdbutil/DiffPrinter.h:43
+    DiffResult operator()(const T &Left, const U &Right) const {
+      return (Left == Right) ? DiffResult::IDENTICAL : DiffResult::EQUIVALENT;
+    }
----------------
I don't quite get this. Basically we have a comparator which says "if they're different, no big deal, they're actually equivalent". Is that more or less the idea? Maybe instead of asking the caller to pass a comparator we should have a different printEquivalent method? It seems shorter and less magical.


================
Comment at: llvm/tools/llvm-pdbutil/DiffPrinter.h:50-51
+             Comparator Comp) {
+    std::string L = formatv("{0}", Left).str();
+    std::string R = formatv("{0}", Right).str();
+
----------------
Having a different entry point for "equivalent" number comparisons would let us hoist these format calls up to the next level, since they don't depend on the comparator.


https://reviews.llvm.org/D35039





More information about the llvm-commits mailing list