[llvm] [nfc][llvm-profdata] Use cl::Subcommand to organize subcommand and options in llvm-profdata (PR #71328)

Snehasish Kumar via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 13 12:01:22 PST 2023


================
@@ -435,13 +450,195 @@ static void writeInstrProfile(StringRef OutputFilename,
   }
 }
 
-static void
-mergeInstrProfile(const WeightedFileVector &Inputs, StringRef DebugInfoFilename,
-                  SymbolRemapper *Remapper, StringRef OutputFilename,
-                  ProfileFormat OutputFormat, uint64_t TraceReservoirSize,
-                  uint64_t MaxTraceLength, int MaxDbgCorrelationWarnings,
-                  bool OutputSparse, unsigned NumThreads, FailureMode FailMode,
-                  const StringRef ProfiledBinary) {
+// Common options.
----------------
snehasish wrote:

Perhaps we can move the common and 2-common set of options to the top of the file, right under subcommands. Since the options are documented (i.e. "options unique to show" etc) I also wouldn't mind moving everything to the top of the file. I don't see a particular reason to keep them near the methods which implement the functionality, particularly since we always parse all options now. What do you think?

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


More information about the llvm-commits mailing list