diff options
author | Max Moroz <mmoroz@chromium.org> | 2019-08-08 19:49:37 +0000 |
---|---|---|
committer | Max Moroz <mmoroz@chromium.org> | 2019-08-08 19:49:37 +0000 |
commit | ddf4f111bd336db92a0a9ae1ebc31bbd64c62511 (patch) | |
tree | 0adf5527c189e64904bf1d304b81f9e2a95ef89f /include/CMakeLists.txt | |
parent | 18c588a374a75b45cd8dc3d98728bb78437a8bfc (diff) | |
download | compiler-rt-ddf4f111bd336db92a0a9ae1ebc31bbd64c62511.tar.gz |
[compiler-rt] Add ConsumeProbability and ConsumeFloatingPoint methods to FDP.
Summary:
Also slightly cleaned up the comments and changed the header's extension
back to `.h` as per comments on https://reviews.llvm.org/D65812.
New methods added:
* `ConsumeProbability` returns [0.0, 1.0] by consuming an unsigned integer value
from the input data and dividing that value by the integer's max value.
* `ConsumeFloatingPointInRange` returns a floating point value in the given
range. Relies on `ConsumeProbability` method. This method does not have the
limitation of `std::uniform_real_distribution` that requires the given range
to be <= the floating point type's max. If the range is too large, this
implementation will additionally call `ConsumeBool` to decide whether the
result will be in the first or the second half of the range.
* `ConsumeFloatingPoint` returns a floating point value in the range
`[std::numeric_limits<T>::lowest(), std::numeric_limits<T>::min()]`.
Tested on Linux, Mac, Windows.
Reviewers: morehouse
Reviewed By: morehouse
Subscribers: kubamracek, mgorny, dberris, delcypher, #sanitizers, llvm-commits
Tags: #llvm, #sanitizers
Differential Revision: https://reviews.llvm.org/D65905
git-svn-id: https://llvm.org/svn/llvm-project/compiler-rt/trunk@368331 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/CMakeLists.txt')
-rw-r--r-- | include/CMakeLists.txt | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/CMakeLists.txt b/include/CMakeLists.txt index d2b2fa0dc..57ed6c3ad 100644 --- a/include/CMakeLists.txt +++ b/include/CMakeLists.txt @@ -15,7 +15,7 @@ if (COMPILER_RT_BUILD_SANITIZERS) sanitizer/tsan_interface_atomic.h ) set(FUZZER_HEADERS - fuzzer/FuzzedDataProvider.hpp + fuzzer/FuzzedDataProvider.h ) endif(COMPILER_RT_BUILD_SANITIZERS) |