This is an archive of the discontinued LLVM Phabricator instance.

Allow to specify multiple -fsanitize-blacklist= arguments.
ClosedPublic

Authored by samsonov on Feb 2 2015, 6:17 PM.

Details

Summary

Allow user to provide multiple blacklists by passing several
-fsanitize-blacklist= options. These options now don't override
default blacklist from Clang resource directory, which is always
applied (which fixes PR22431).

-fno-sanitize-blacklist option now disables all blacklists that
were specified earlier in the command line (including the default
one).

Expand the test case to check that both -fsanitize-blacklist= values are handled.

This change depends on http://reviews.llvm.org/D7367.

Diff Detail

Repository
rL LLVM

Event Timeline

samsonov updated this revision to Diff 19208.Feb 2 2015, 6:17 PM
samsonov retitled this revision from to Allow to specify multiple -fsanitize-blacklist= arguments..
samsonov updated this object.
samsonov edited the test plan for this revision. (Show Details)
samsonov added a reviewer: timurrrr.
samsonov added subscribers: pcc, kcc, Unknown Object (MLST).
rsmith accepted this revision.Feb 2 2015, 6:49 PM
rsmith added a reviewer: rsmith.
rsmith added a subscriber: rsmith.

LGTM, though I'd like a bit more thorough testing. The current tests would pass, for instance, if we just stopped after the first -fsanitize-blacklist= argument.

This revision is now accepted and ready to land.Feb 2 2015, 6:49 PM
timurrrr edited edge metadata.Feb 3 2015, 3:12 AM

I agree more tests would be welcome, especially a test like

-fsanitize-blacklist=1.txt -fno-sanitize-blacklist -fsanitize-blacklist=2.txt

that documents the [rather strange to my taste] behavior of -fno-sanitize-blacklist

lib/Driver/SanitizerArgs.cpp
300 ↗(On Diff #19208)

nit: I find

if (llvm::sys::fs::exists(BLPath))
  BlacklistFiles.push_back(BLPath);
else
  D.Diag(clang::diag::err_drv_no_such_file) << BLPath;

shorter and easier to understand

305 ↗(On Diff #19208)

very nitty nit: you can fit into 80 chars if you shorten BLArg to say Arg?

samsonov updated this revision to Diff 19241.Feb 3 2015, 10:14 AM
samsonov edited edge metadata.
  • Address reviewer's comments and add more tests.
samsonov added inline comments.Feb 3 2015, 1:49 PM
lib/Driver/SanitizerArgs.cpp
300 ↗(On Diff #19208)

Done

305 ↗(On Diff #19208)

Done

timurrrr accepted this revision.Feb 4 2015, 5:22 AM
timurrrr edited edge metadata.

LGTM, thanks!

This revision was automatically updated to reflect the committed changes.