[PATCH] D87953: [xray] Function coverage groups

Ian Levesque via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Sep 21 16:12:05 PDT 2020


ianlevesque marked 7 inline comments as done.
ianlevesque added inline comments.


================
Comment at: clang/lib/CodeGen/CodeGenFunction.cpp:814
+    auto FuncGroups = CGM.getCodeGenOpts().XRayTotalFunctionGroups;
+    if (FuncGroups > 1) {
+      auto FuncName = ArrayRef<uint8_t>(CurFn->getName().bytes_begin(),
----------------
MaskRay wrote:
> kyulee wrote:
> > MaskRay wrote:
> > > For one group, the branch is skipped, which does not seem correct
> > Should we check or assert `XRaySelectedFunctionGroups > 0` && `XRaySelectedFunctionGroup < XRaySelectedFunctionGroups` or the former at minimum?
> Such checks are usually done in Driver. In CodeGen, as long as it doesn't crash, there is no need imposing stricter checks.
If there is only 1 group (the default value), then all functions that would be otherwise instrumented are. So there should be no need to do anything.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D87953



More information about the cfe-commits mailing list