summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/FuzzerTracePC.h
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerTracePC.h')
-rw-r--r--llvm/lib/Fuzzer/FuzzerTracePC.h20
1 files changed, 5 insertions, 15 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerTracePC.h b/llvm/lib/Fuzzer/FuzzerTracePC.h
index 06db3d0dd42..f690bb48851 100644
--- a/llvm/lib/Fuzzer/FuzzerTracePC.h
+++ b/llvm/lib/Fuzzer/FuzzerTracePC.h
@@ -61,15 +61,7 @@ class TracePC {
return UseValueProfile && MaxValueProfileMap->MergeFrom(ValueProfileMap);
}
- size_t GetNewPCIDs(uintptr_t **NewPCIDsPtr) {
- *NewPCIDsPtr = NewPCIDs;
- return Min(kMaxNewPCIDs, NumNewPCIDs);
- }
-
- uintptr_t GetPCbyPCID(uintptr_t PCID) { return PCs[PCID]; }
-
void ResetMaps() {
- NumNewPCIDs = 0;
ValueProfileMap.Reset();
memset(Counters, 0, sizeof(Counters));
}
@@ -95,19 +87,17 @@ class TracePC {
TableOfRecentCompares<uint64_t, kTORCSize> TORC8;
void PrintNewPCs();
+ size_t GetNumPCs() const { return Min(kNumPCs, NumGuards + 1); }
+ uintptr_t GetPC(size_t Idx) {
+ assert(Idx < GetNumPCs());
+ return PCs[Idx];
+ }
private:
bool UseCounters = false;
bool UseValueProfile = false;
bool DoPrintNewPCs = false;
- static const size_t kMaxNewPCIDs = 1024;
- uintptr_t NewPCIDs[kMaxNewPCIDs];
- size_t NumNewPCIDs = 0;
- void AddNewPCID(uintptr_t PCID) {
- NewPCIDs[(NumNewPCIDs++) % kMaxNewPCIDs] = PCID;
- }
-
struct Module {
uint32_t *Start, *Stop;
};
OpenPOWER on IntegriCloud