zequanwu added inline comments.

================
Comment at: clang/lib/CodeGen/CGExprScalar.cpp:4812
+        } else
+          CGF.incrementProfileCounter(E);
+      }
----------------
This can be hoist outside `if (llvm::EnableSingleByteCoverage)`


================
Comment at: clang/lib/CodeGen/CodeGenPGO.cpp:1080-1081
+void CodeGenPGO::setProfileVersion(llvm::Module &M) {
+  if (CGM.getCodeGenOpts().hasProfileClangInstr() &&
+      llvm::EnableSingleByteCoverage) {
+    const StringRef VarName(INSTR_PROF_QUOTE(INSTR_PROF_RAW_VERSION_VAR));
----------------
I thinkit's better to emit the profile version global variable in 
`CoverageMappingModuleGen::emit` so this check 
`CGM.getCodeGenOpts().hasProfileClangInstr()` is not necessary. 

Also we should always emit the profile version global variable so that the 
runtime/backend knows if single byte coverage is enabled or not by looking at 
the version.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D126586

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to