leonardchan added inline comments.
================ Comment at: llvm/lib/Transforms/Instrumentation/SanitizerCoverage.cpp:750 Constant::getNullValue(ArrayTy), "__sancov_gen_"); + appendToCompilerUsed(*CurModule, {Array}); ---------------- chandlerc wrote: > There is a `GlobalsToAppendToCompilerUsed` vector that we append `Array` to > below (line 759). Why isn't that sufficient instead of this? Ah, I didn't actually see this for some reason. The reason why it wasn't working before was bc I left the code that called ``` if (TargetTriple.isOSBinFormatMachO()) appendToUsed(M, GlobalsToAppendToUsed); appendToCompilerUsed(M, GlobalsToAppendToCompilerUsed); ``` in `initializeModule`, so this never got appended. Fixed by moving this to a `finalizeModule` which runs after the function runs end. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D62888/new/ https://reviews.llvm.org/D62888 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits