For Posix systems and Windows, we need to consider different cases.
Differential Revision: https://reviews.llvm.org/D28633
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@292738
91177308-0d34-0410-b5e6-
96231b3b80d8
// Returns path to a TmpDir.
std::string TmpDir();
+bool IsInterestingCoverageFile(const std::string &FileName);
+
void DupAndCloseStderr();
void CloseStdout();
return "/tmp";
}
+bool IsInterestingCoverageFile(const std::string &FileName) {
+ if (FileName.find("compiler-rt/lib/") != std::string::npos)
+ return false; // sanitizer internal.
+ if (FileName.find("/usr/lib/") != std::string::npos)
+ return false;
+ if (FileName.find("/usr/include/") != std::string::npos)
+ return false;
+ if (FileName == "<null>")
+ return false;
+ return true;
+}
+
} // namespace fuzzer
#endif // LIBFUZZER_POSIX
std::string TmpDir() { return "TODO: implement TmpDir"; }
+bool IsInterestingCoverageFile(const std::string &FileName) {
+ if (FileName.find("Program Files") != std::string::npos)
+ return false;
+ if (FileName.find("compiler-rt\\lib\\") != std::string::npos)
+ return false; // sanitizer internal.
+ if (FileName == "<null>")
+ return false;
+ return true;
+}
+
} // namespace fuzzer
#endif // LIBFUZZER_WINDOWS
HandleValueProfile(Idx);
}
-static bool IsInterestingCoverageFile(std::string &File) {
- if (File.find("compiler-rt/lib/") != std::string::npos)
- return false; // sanitizer internal.
- if (File.find("/usr/lib/") != std::string::npos)
- return false;
- if (File.find("/usr/include/") != std::string::npos)
- return false;
- if (File == "<null>")
- return false;
- return true;
-}
-
void TracePC::InitializePrintNewPCs() {
if (!DoPrintNewPCs) return;
assert(!PrintedPCs);