[llvm] [nfc][llvm-profdata]Refactor llvm-profdata showInstrProfile (PR #71328)

Mircea Trofin via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 6 08:59:29 PST 2023


================
@@ -2406,6 +2407,14 @@ static void traverseAllValueSites(const InstrProfRecord &Func, uint32_t VK,
   }
 }
 
+namespace {
+struct InstrProfilePerFuncOptions {
+  bool ShowCounts;
----------------
mtrofin wrote:

please initialize scalars at declaration (i.e. `bool ShowCounts = false`), it's very easy to later write code that forgets to initialize a field, and while maybe noticing compiler warnings can highlight this, it's so much easier to just initialize at declaration and avoid undefined behavior!

https://github.com/llvm/llvm-project/pull/71328


More information about the llvm-commits mailing list