[PATCH] D89524: [NFC][SampleFDO] Move some common stuff from SampleProfileReaderExtBinary/SampleProfileWriterExtBinary to their parent classes.

Hongtao Yu via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Oct 17 20:38:38 PDT 2020


hoy added inline comments.


================
Comment at: llvm/lib/ProfileData/SampleProfWriter.cpp:206
+  switch (Type) {
+  case SecProfileSymbolList:
+    if (auto EC = writeProfileSymbolListSection())
----------------
Why is this separated from `writeOneSection`?


================
Comment at: llvm/lib/ProfileData/SampleProfWriter.cpp:250
+    const StringMap<FunctionSamples> &ProfileMap) {
+  if (auto EC = writeOneSection(SecProfSummary, ProfileMap))
     return EC;
----------------
Thanks for the refactoring which looks much cleaner.


================
Comment at: llvm/lib/ProfileData/SampleProfWriter.cpp:257
+  // The setting about the section flag should happen before writeOneSection.
+  if (ProfSymList && ProfSymList->toCompress())
+    setToCompressSection(SecProfileSymbolList);
----------------
Can this be moved into `writeProfileSymbolListSection`?


Repository:
  rL LLVM

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

https://reviews.llvm.org/D89524



More information about the llvm-commits mailing list