[PATCH] D27233: [libFuzzer] Diff 3 - Split IO implementation for Windows and Posix.

Marcos Pividori via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 30 10:59:25 PST 2016


mpividori added inline comments.


================
Comment at: lib/Fuzzer/FuzzerIO.cpp:19
 #include <sys/stat.h>
+#if LIBFUZZER_POSIX
 #include <unistd.h>
----------------
kcc wrote:
> can you avoid this ifdef? 
> E.g. move whatever needs  unistd.h into *Posix* file
@kcc Ok. I will move `DeleteFile()` implementation to the files `FuzzerIOPosix.cpp` and `FuzzerIOWindows.cpp`.


================
Comment at: lib/Fuzzer/FuzzerIOPlatform.h:1
+//===- FuzzerIOPlatform.h - Internal header for IO plat. utils --*- C++ -* ===//
+//
----------------
kcc wrote:
> why do we need both FuzzerIO.h and FuzzerIOPlatform.h? 
@kcc , The initial idea was to separate `FuzzerIO.h` and `FuzzerIOPlatform.h`, so `FuzzerIO.h` includes functions used by the rest of the modules, and `FuzzerIOPlatform.h` includes the platform specific functions only included by the `FuzzerIO.cpp` implementation.
But with recent changes, this is not valid any more, because some implementations need to access some functions from FuzzerIO platform specific implementation like `DeleteFile()`, so I will merge both headers files into `FuzzerIO.h`.


Repository:
  rL LLVM

https://reviews.llvm.org/D27233





More information about the llvm-commits mailing list