Skip to content
Snippets Groups Projects
Commit 22dc02b1 authored by Alexey Samsonov's avatar Alexey Samsonov
Browse files

Cleanup SanitizerArgs: get rid of unused variable, make one method non-static. NFC.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@221959 91177308-0d34-0410-b5e6-96231b3b80d8
parent c806720c
No related branches found
No related tags found
No related merge requests found
...@@ -86,6 +86,8 @@ class SanitizerArgs { ...@@ -86,6 +86,8 @@ class SanitizerArgs {
private: private:
void clear(); void clear();
bool getDefaultBlacklist(const Driver &D, std::string &BLPath);
/// Parse a single value from a -fsanitize= or -fno-sanitize= value list. /// Parse a single value from a -fsanitize= or -fno-sanitize= value list.
/// Returns OR of members of the \c SanitizeKind enumeration, or \c 0 /// Returns OR of members of the \c SanitizeKind enumeration, or \c 0
/// if \p Value is not known. /// if \p Value is not known.
...@@ -119,9 +121,6 @@ class SanitizerArgs { ...@@ -119,9 +121,6 @@ class SanitizerArgs {
const llvm::opt::Arg *A, const llvm::opt::Arg *A,
unsigned Mask); unsigned Mask);
static bool getDefaultBlacklistForKind(const Driver &D, unsigned Kind,
std::string &BLPath);
/// Return the smallest superset of sanitizer set \p Kinds such that each /// Return the smallest superset of sanitizer set \p Kinds such that each
/// member of each group whose flag is set in \p Kinds has its flag set in the /// member of each group whose flag is set in \p Kinds has its flag set in the
/// result. /// result.
......
...@@ -36,8 +36,6 @@ void SanitizerArgs::clear() { ...@@ -36,8 +36,6 @@ void SanitizerArgs::clear() {
SanitizerArgs::SanitizerArgs(const ToolChain &TC, SanitizerArgs::SanitizerArgs(const ToolChain &TC,
const llvm::opt::ArgList &Args) { const llvm::opt::ArgList &Args) {
clear(); clear();
unsigned AllAdd = 0; // All kinds of sanitizers that were turned on
// at least once (possibly, disabled further).
unsigned AllRemove = 0; // During the loop below, the accumulated set of unsigned AllRemove = 0; // During the loop below, the accumulated set of
// sanitizers disabled by the current sanitizer // sanitizers disabled by the current sanitizer
// argument or any argument after it. // argument or any argument after it.
...@@ -51,7 +49,6 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC, ...@@ -51,7 +49,6 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC,
continue; continue;
(*I)->claim(); (*I)->claim();
AllAdd |= expandGroups(Add);
AllRemove |= expandGroups(Remove); AllRemove |= expandGroups(Remove);
// Avoid diagnosing any sanitizer which is disabled later. // Avoid diagnosing any sanitizer which is disabled later.
...@@ -134,8 +131,7 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC, ...@@ -134,8 +131,7 @@ SanitizerArgs::SanitizerArgs(const ToolChain &TC,
// If no -fsanitize-blacklist option is specified, try to look up for // If no -fsanitize-blacklist option is specified, try to look up for
// blacklist in the resource directory. // blacklist in the resource directory.
std::string BLPath; std::string BLPath;
if (getDefaultBlacklistForKind(D, Kind, BLPath) && if (getDefaultBlacklist(D, BLPath) && llvm::sys::fs::exists(BLPath))
llvm::sys::fs::exists(BLPath))
BlacklistFile = BLPath; BlacklistFile = BLPath;
} }
...@@ -364,8 +360,7 @@ std::string SanitizerArgs::describeSanitizeArg(const llvm::opt::ArgList &Args, ...@@ -364,8 +360,7 @@ std::string SanitizerArgs::describeSanitizeArg(const llvm::opt::ArgList &Args,
return "-fsanitize=" + Sanitizers; return "-fsanitize=" + Sanitizers;
} }
bool SanitizerArgs::getDefaultBlacklistForKind(const Driver &D, unsigned Kind, bool SanitizerArgs::getDefaultBlacklist(const Driver &D, std::string &BLPath) {
std::string &BLPath) {
const char *BlacklistFile = nullptr; const char *BlacklistFile = nullptr;
if (Kind & NeedsAsanRt) if (Kind & NeedsAsanRt)
BlacklistFile = "asan_blacklist.txt"; BlacklistFile = "asan_blacklist.txt";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment