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

David Li via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed Jan 20 17:25:39 PST 2021


davidxl added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenModule.cpp:2591
+  }
+  return false;
+}
----------------
phosek wrote:
> davidxl wrote:
> > 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?
> That's correct, would you expect a different behavior and if so what should that behavior be?
> 
> Currently, the profile list is used to build up a list of functions and files that should be instrumented. Any function or file that's not covered by the profile list is automatically excluded (not included may be more correct). Having just excludes without any includes means that nothing will be instrumented.
It is natural and more useful to let user simply specify exclude lists so they don't need to worry about patterns of other functions to be instrumented.

This means that when only exclude list is specified, the default should be flipped to be true (instrument everything else).

If there only include list, the default is false.

If there are both, the include list should be used to specify a super set while the exclude list (taking precedence) used to specify a subset from the super set.


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

https://reviews.llvm.org/D94820



More information about the cfe-commits mailing list