summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Fuzzer/FuzzerDictionary.h
diff options
context:
space:
mode:
authorKostya Serebryany <kcc@google.com>2016-10-25 02:04:43 +0000
committerKostya Serebryany <kcc@google.com>2016-10-25 02:04:43 +0000
commit3364f907836d50482f77c7def3952b09e99caa97 (patch)
tree9891c2d477c59f4a0baeb65b8066650d183b060c /llvm/lib/Fuzzer/FuzzerDictionary.h
parent7695cb6da8021ef610ffbcf3b296a16688c7930d (diff)
downloadbcm5719-llvm-3364f907836d50482f77c7def3952b09e99caa97.tar.gz
bcm5719-llvm-3364f907836d50482f77c7def3952b09e99caa97.zip
[libFuzzer] simplify the code for use_cmp, also use the position hint when available, add a test
llvm-svn: 285049
Diffstat (limited to 'llvm/lib/Fuzzer/FuzzerDictionary.h')
-rw-r--r--llvm/lib/Fuzzer/FuzzerDictionary.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/lib/Fuzzer/FuzzerDictionary.h b/llvm/lib/Fuzzer/FuzzerDictionary.h
index 821cf9bd001..c009838ced6 100644
--- a/llvm/lib/Fuzzer/FuzzerDictionary.h
+++ b/llvm/lib/Fuzzer/FuzzerDictionary.h
@@ -68,6 +68,13 @@ class DictionaryEntry {
size_t GetUseCount() const { return UseCount; }
size_t GetSuccessCount() const {return SuccessCount; }
+ void Print(const char *PrintAfter = "\n") {
+ PrintASCII(W.data(), W.size());
+ if (HasPositionHint())
+ Printf("@%zd", GetPositionHint());
+ Printf("%s", PrintAfter);
+ }
+
private:
Word W;
size_t PositionHint = std::numeric_limits<size_t>::max();
OpenPOWER on IntegriCloud