[PATCH] D83013: [LPM] Port CGProfilePass from NPM to LPM

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 1 22:11:12 PDT 2020


MaskRay added inline comments.


================
Comment at: llvm/lib/Transforms/Instrumentation/CGProfile.cpp:28
+namespace {
+static bool
+addModuleFlags(Module &M,
----------------
a static function does not need to be wrapped inside an unnamed namespace


================
Comment at: llvm/lib/Transforms/Instrumentation/CGProfile.cpp:101
 
-void CGProfilePass::addModuleFlags(
-    Module &M,
-    MapVector<std::pair<Function *, Function *>, uint64_t> &Counts) const {
-  if (Counts.empty())
-    return;
+struct CGProfileLegacyPass : public ModulePass {
+  static char ID;
----------------
wrap a struct/class in an unnamed namespace to prevent name collision


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D83013





More information about the llvm-commits mailing list