[PATCH] Allow to specify multiple -fsanitize-blacklist= arguments.
Timur Iskhodzhanov
timurrrr at google.com
Tue Feb 3 03:12:23 PST 2015
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`
================
Comment at: lib/Driver/SanitizerArgs.cpp:300
@@ -292,12 +299,3 @@
std::string BLPath = BLArg->getValue();
- if (llvm::sys::fs::exists(BLPath)) {
- // Validate the blacklist format.
- std::string BLError;
- std::unique_ptr<llvm::SpecialCaseList> SCL(
- llvm::SpecialCaseList::create(BLPath, BLError));
- if (!SCL.get())
- D.Diag(clang::diag::err_drv_malformed_sanitizer_blacklist) << BLError;
- else
- BlacklistFile = BLPath;
- } else {
+ if (!llvm::sys::fs::exists(BLPath)) {
D.Diag(clang::diag::err_drv_no_such_file) << BLPath;
----------------
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
================
Comment at: lib/Driver/SanitizerArgs.cpp:305
@@ +304,3 @@
+ BlacklistFiles.push_back(BLPath);
+ } else if (BLArg->getOption().matches(
+ options::OPT_fno_sanitize_blacklist)) {
----------------
very nitty nit: you can fit into 80 chars if you shorten `BLArg` to say `Arg`?
http://reviews.llvm.org/D7368
EMAIL PREFERENCES
http://reviews.llvm.org/settings/panel/emailpreferences/
More information about the cfe-commits
mailing list