You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, it is not possible to instrument Swift code with `-sanitize-coverage` without attaching one of the sanitizer runtime (`address`, `fuzzer`, etc.). This prevents writing Swift programs that make use of that instrumentation, such as code coverage analysis tools or fuzzing engines.
It seems like the reason for this limitation is to make the command line `swiftc` tool more user-friendly. From the source code at `lib/Options/SanitizerOptions.cpp`, line 112:
// Running the sanitizer coverage pass will add undefined symbols to// functions in compiler-rt's "sanitizer_common". "sanitizer_common" isn't// shipped as a separate library we can link with. However those are defined// in the various sanitizer runtime libraries so we require that we are// doing a sanitized build so we pick up the required functions during// linking.if (opts.CoverageType != llvm::SanitizerCoverageOptions::SCK_None &&
!sanitizers) {
Diags.diagnose(SourceLoc(), diag::error_option_requires_sanitizer,
A->getSpelling());
returnllvm::SanitizerCoverageOptions();
}
It would be great if that check could be removed, or be replaced with a warning instead of an error.
The text was updated successfully, but these errors were encountered:
Additional Detail from JIRA
md5: ea11db8a811c0ec5228af1bd74dfc0a7
Issue Description:
Currently, it is not possible to instrument Swift code with `-sanitize-coverage` without attaching one of the sanitizer runtime (`address`, `fuzzer`, etc.). This prevents writing Swift programs that make use of that instrumentation, such as code coverage analysis tools or fuzzing engines.
It seems like the reason for this limitation is to make the command line `swiftc` tool more user-friendly. From the source code at `lib/Options/SanitizerOptions.cpp`, line 112:
It would be great if that check could be removed, or be replaced with a warning instead of an error.
The text was updated successfully, but these errors were encountered: