This is an archive of the discontinued LLVM Phabricator instance.

[sanitizer_common] Fuchsia-specific implementation of SanitizerCoverage
ClosedPublic

Authored by mcgrathr on Jul 25 2017, 4:07 PM.

Diff Detail

Event Timeline

mcgrathr created this revision.Jul 25 2017, 4:07 PM
mcgrathr added a project: Restricted Project.Jul 25 2017, 4:07 PM
mcgrathr added subscribers: llvm-commits, phosek.
vitalybuka added a subscriber: vitalybuka.

LGTM, please let others to check

lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc
20

To other reviewers:
Sanitizers are inconsistent here. Some files are disabled in cmake other files with such #ifs. Why is it so?

kcc accepted this revision.Jul 27 2017, 2:41 PM

What about tests?
(Well, this probably applies to all fuchsia-related patches).

It's sad that you had to copy-paste this much code, but as long as the Fuchsia teams supports this code (and we don't have to) -- ok.

This revision is now accepted and ready to land.Jul 27 2017, 2:41 PM
filcab added a subscriber: filcab.Jul 28 2017, 4:48 AM
filcab added inline comments.
lib/sanitizer_common/sanitizer_coverage_fuchsia.cc
33

Include sanitizer_platform.h then immediately test for SANITIZER_FUCHSIA. That way you don't re-parse as many files.

lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc
20

Same as above.

20

Indeed. I think we should use CMake whenever the test is easy (host OS, target os, etc). But some tests are more involved and are better off being done after all the includes, I guess.

mcgrathr added inline comments.Jul 28 2017, 1:50 PM
lib/sanitizer_common/sanitizer_coverage_fuchsia.cc
33

Other files are inconsistent in whether they do this, so I took the one that's shorter.
But I'm happy to do this change.

lib/sanitizer_common/sanitizer_coverage_libcdep_new.cc
20

From what I've seen, the vast majority of cases are unconditional in cmake and use #if around the whole file, so that's the model I followed.

mcgrathr updated this revision to Diff 108705.Jul 28 2017, 1:52 PM

include only sanitizer_platform.h before '#if SANITIZER_FUCHSIA'

mcgrathr updated this revision to Diff 108708.Jul 28 2017, 2:04 PM
mcgrathr updated this revision to Diff 108736.Jul 28 2017, 3:53 PM

Rebased after D35864 split up into smaller changes.

mcgrathr updated this revision to Diff 109192.Aug 1 2017, 1:23 PM

This is rebased and ready to land.
Please land it for me!

Thanks,
Roland

This revision was automatically updated to reflect the committed changes.