[PATCH] D96387: [CSSPGO][llvm-profgen] Renovate perfscript check and command line input validation

Lei Wang via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 12 11:59:48 PST 2021


wlei added inline comments.


================
Comment at: llvm/tools/llvm-profgen/ProfileGenerator.cpp:81
 void ProfileGenerator::write() {
+  StringRef OutputFilename = PerfReader::getOutputFilename();
   auto WriterOrErr = SampleProfileWriter::create(OutputFilename, OutputFormat);
----------------
wenlei wrote:
> Why do we need to go through PerfReader::getOutputFilename in order to access the output file from command line? 
> 
> Same for ProfiledBinary::isShowDisassemblyOnlyEnabled etc., can we access the global directly (add extern declaration if needed)? These wrappers seem a bit overkill given they're not really per-binary for per-reader config.
> StringRef OutputFilename = PerfReader::getOutputFilename();
yeah, I miss to remove this.

> can we access the global directly (add extern declaration if needed)? 
I thought to use static function wrapper as the global. Yeah, use an extern global is clearer. Let me change it 


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D96387



More information about the llvm-commits mailing list