[PATCH] D28633: [libFuzzer] Portable implementation of `IsInterestingCoverageFile()`.

Marcos Pividori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sat Jan 21 17:38:58 PST 2017


This revision was automatically updated to reflect the committed changes.
Closed by commit rL292738: [libFuzzer] Portable implementation of `IsInterestingCoverageFile()`. (authored by mpividori).

Changed prior to commit:
  https://reviews.llvm.org/D28633?vs=84211&id=85259#toc

Repository:
  rL LLVM

https://reviews.llvm.org/D28633

Files:
  llvm/trunk/lib/Fuzzer/FuzzerIO.h
  llvm/trunk/lib/Fuzzer/FuzzerIOPosix.cpp
  llvm/trunk/lib/Fuzzer/FuzzerIOWindows.cpp
  llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp


Index: llvm/trunk/lib/Fuzzer/FuzzerIOPosix.cpp
===================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerIOPosix.cpp
+++ llvm/trunk/lib/Fuzzer/FuzzerIOPosix.cpp
@@ -89,6 +89,18 @@
   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
Index: llvm/trunk/lib/Fuzzer/FuzzerIO.h
===================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerIO.h
+++ llvm/trunk/lib/Fuzzer/FuzzerIO.h
@@ -40,6 +40,8 @@
 // Returns path to a TmpDir.
 std::string TmpDir();
 
+bool IsInterestingCoverageFile(const std::string &FileName);
+
 void DupAndCloseStderr();
 
 void CloseStdout();
Index: llvm/trunk/lib/Fuzzer/FuzzerIOWindows.cpp
===================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerIOWindows.cpp
+++ llvm/trunk/lib/Fuzzer/FuzzerIOWindows.cpp
@@ -279,6 +279,16 @@
 
 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
Index: llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp
===================================================================
--- llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp
+++ llvm/trunk/lib/Fuzzer/FuzzerTracePC.cpp
@@ -66,18 +66,6 @@
   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);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D28633.85259.patch
Type: text/x-patch
Size: 2447 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170122/3f4f0370/attachment.bin>


More information about the llvm-commits mailing list