[PATCH] D110729: [llvm-profgen] Refactor and better diagnostics

Wenlei He via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Sep 29 09:43:02 PDT 2021


wenlei added inline comments.


================
Comment at: llvm/tools/llvm-profgen/PerfReader.cpp:844
 
-void PerfReaderBase::parsePerfTraces(
-    cl::list<std::string> &PerfTraceFilenames) {
+void PerfReaderBase::parsePerfTraces() {
   // Parse perf traces and do aggregation.
----------------
Remove the file name parameter because we have check perf script type in `create`. Providing file name here opens up the possibility of checking perf script type on one file, but parsePerfTraces on a different file. Now file name is passed in through ctor and stored as a member. 


================
Comment at: llvm/tools/llvm-profgen/llvm-profgen.cpp:51
 // Validate the command line input.
-static void validateCommandLine(StringRef BinaryPath,
-                                cl::list<std::string> &PerfTraceFilenames) {
+static void validateCommandLine() {
+  // Validate input profile is provided only once
----------------
We were accessing cl option `ShowDisassemblyOnly` and `ShowSourceLocations` directly, but passing `BinaryPath` and `PerfTraceFilenames` through parameters. Fix to always access cl option directly to be consistent.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D110729



More information about the llvm-commits mailing list