[PATCH] D20085: [libfuzzer] Refactoring coverage state-management code..

Kostya Serebryany via llvm-commits llvm-commits at lists.llvm.org
Tue May 10 15:29:18 PDT 2016


kcc added inline comments.

================
Comment at: lib/Fuzzer/FuzzerInternal.h:321
@@ +320,3 @@
+
+    std::string DebugString() const;
+
----------------
is this used? 

================
Comment at: lib/Fuzzer/FuzzerLoop.cpp:401
@@ -314,3 +400,3 @@
 
-  PrepareCoverageBeforeRun();
+  CoverageController::ResetCounters(Options);
   ExecuteCallback(Data, Size);
----------------
aizatsky wrote:
> BTW all tests pass without this call, but you used to have it before. Do you want me to keep it?
let's not make too many changes at the same time, leave it for now. 

================
Comment at: lib/Fuzzer/FuzzerTracePC.h:2
@@ +1,3 @@
+//===- FuzzerTracePC.h - INTERNAL - Path tracer i-face. --------*- C++ -* ===//
+//
+//                     The LLVM Compiler Infrastructure
----------------
No, this header is fine, I just don't like i-face. Just leave "Path tracer"

================
Comment at: lib/Fuzzer/FuzzerTracePC.h:9
@@ +8,3 @@
+//===----------------------------------------------------------------------===//
+// Define the main class fuzzer::Fuzzer and most functions.
+//===----------------------------------------------------------------------===//
----------------
Fix the comment (move from the cpp file)

================
Comment at: lib/Fuzzer/FuzzerTracePC.h:25
@@ +24,3 @@
+  size_t MergeFrom(const PcCoverageMap &Other) {
+    uintptr_t Res = 0;
+    for (size_t i = 0; i < kMapSizeInWords; i++)
----------------
move the code to cpp file

================
Comment at: lib/Fuzzer/FuzzerTracePC.h:32
@@ +31,3 @@
+  inline void Update(uintptr_t Addr) {
+    uintptr_t Idx = Addr % kMapSizeInBits;
+    uintptr_t WordIdx = Idx / kBitsInWord;
----------------
ditto 


http://reviews.llvm.org/D20085





More information about the llvm-commits mailing list