[PATCH] D94820: Support for instrumenting only selected files or functions

David Li via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 19 13:22:47 PST 2021


davidxl added inline comments.


================
Comment at: clang/docs/SourceBasedCodeCoverage.rst:77
+the files and functions specified in ``file.list`` will be instrumented.  The
+option can be specified multiple times to pass multiple files:
+
----------------
perhaps documenting how compiler generated functions are handled? 


================
Comment at: clang/docs/SourceBasedCodeCoverage.rst:86
+.. code-block:: none
+
+  # all functions whose name starts with foo will be instrumented.
----------------
what is the default section name?


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:2569
+  // If the profile list is empty, then instrument everything.
+  if (ProfileList.isEmpty())
+    return true;
----------------
Should the option to turn on instrumentation also be checked?


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:2591
+  }
+  return false;
+}
----------------
If the profile list contains only one line of exclude list, it seems that all functions will be rejected as the function returns 'false' by default for all other functions?


================
Comment at: clang/lib/CodeGen/CodeGenModule.h:1280
 
+  bool isProfileInstrumented(llvm::Function *Fn, SourceLocation Loc,
+                             StringRef Section = StringRef()) const;
----------------
Document the method and params.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D94820



More information about the cfe-commits mailing list