summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/FuzzerInternal.h
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2016-02-26 21:33:56 +0000
committerKostya Serebryany <kcc@google.com>2016-02-26 21:33:56 +0000
commitda63c1d09a82471d9fdbd396b5da23d34485da00 (patch)
tree9ad6b830ddcf7db3220d077b1a2dff2895db1f0e /llvm/lib/Fuzzer/FuzzerInternal.h
parent297ce4ece982ad6bcf4d3e722dec0ff91469c323 (diff)
downloadbcm5719-llvm-da63c1d09a82471d9fdbd396b5da23d34485da00.tar.gz
bcm5719-llvm-da63c1d09a82471d9fdbd396b5da23d34485da00.zip
[libFuzzer] initial implementation of path coverage based on -fsanitize-coverage=trace-pc. This does not scale well yet, but already cracks FullCoverageSetTest in seconds
llvm-svn: 262073
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerInternal.h')
-rw-r--r--llvm/lib/Fuzzer/FuzzerInternal.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerInternal.h b/llvm/lib/Fuzzer/FuzzerInternal.h
index 1c941abd13b..03905c2ec3a 100644
--- a/llvm/lib/Fuzzer/FuzzerInternal.h
+++ b/llvm/lib/Fuzzer/FuzzerInternal.h
@@ -99,6 +99,13 @@ bool IsASCII(const Unit &U);
int NumberOfCpuCores();
int GetPid();
+// Clears the current PC Map.
+void PcMapResetCurrent();
+// Merges the current PC Map into the combined one, and clears the former.
+void PcMapMergeCurrentToCombined();
+// Returns the size of the combined PC Map.
+size_t PcMapCombinedSize();
+
class Random {
public:
Random(unsigned int seed) : R(seed) {}
@@ -390,6 +397,7 @@ private:
long TimeOfLongestUnitInSeconds = 0;
long EpochOfLastReadOfOutputCorpus = 0;
size_t LastRecordedBlockCoverage = 0;
+ size_t LastRecordedPcMapSize = 0;
size_t LastRecordedCallerCalleeCoverage = 0;
size_t LastCoveragePcBufferLen = 0;
};
OpenPOWER on IntegriCloud