This is an archive of the discontinued LLVM Phabricator instance.

Allow -fsanitize-coverage=N with ubsan, clang part
ClosedPublic

Authored by kcc on Jan 5 2015, 2:53 PM.

Details

Summary

Allow -fsanitize-coverage=N with ubsan, clang part.
This simply allows the flag combination.
The LLVM will work out of the box, the compile-rt part
will follow as a separate patch.

Diff Detail

Event Timeline

kcc updated this revision to Diff 17814.Jan 5 2015, 2:53 PM
kcc retitled this revision from to Allow -fsanitize-coverage=N with ubsan, clang part.
kcc updated this object.
kcc edited the test plan for this revision. (Show Details)
kcc added a reviewer: samsonov.
kcc added a subscriber: Unknown Object (MLST).
samsonov added inline comments.Jan 5 2015, 3:23 PM
lib/Driver/SanitizerArgs.cpp
299

NeedsUbsanRt is a compile-time constant. You probably should use

needsUbsanRt()

(omg, it's terrible). You may consider adding a test that -fsanitize-coverage=1 is reported as unused argument for, e.g., -fsanitize=dataflow

samsonov added inline comments.Jan 5 2015, 3:26 PM
lib/Driver/SanitizerArgs.cpp
299

As an alternative, introduce new SanitizeKind

SupportsCoverage = Address | Memory | Leak | Undefined | Integer,

and replace this if with

if (Kinds & SupportsCoverage) { ... }
samsonov added inline comments.Jan 5 2015, 3:28 PM
lib/Driver/SanitizerArgs.cpp
299

That is,

hasOneOf(Sanitizers, SupportsCoverage)
kcc updated this revision to Diff 17818.Jan 5 2015, 3:35 PM

addressed Alexey's comments

samsonov accepted this revision.Jan 5 2015, 4:19 PM
samsonov edited edge metadata.

LGTM

This revision is now accepted and ready to land.Jan 5 2015, 4:19 PM
kcc closed this revision.Jan 5 2015, 5:03 PM