aboutsummaryrefslogtreecommitdiff
path: root/lib/scudo/scudo_crc32.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/scudo/scudo_crc32.cpp')
-rw-r--r--lib/scudo/scudo_crc32.cpp17
1 files changed, 3 insertions, 14 deletions
diff --git a/lib/scudo/scudo_crc32.cpp b/lib/scudo/scudo_crc32.cpp
index 94c8c2424929..56be22f4ee62 100644
--- a/lib/scudo/scudo_crc32.cpp
+++ b/lib/scudo/scudo_crc32.cpp
@@ -12,13 +12,13 @@
///
//===----------------------------------------------------------------------===//
+#include "sanitizer_common/sanitizer_internal_defs.h"
+
// Hardware CRC32 is supported at compilation via the following:
// - for i386 & x86_64: -msse4.2
// - for ARM & AArch64: -march=armv8-a+crc or -mcrc
// An additional check must be performed at runtime as well to make sure the
// emitted instructions are valid on the target host.
-#include "scudo_crc32.h"
-#include "scudo_utils.h"
#if defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32)
# ifdef __SSE4_2__
@@ -34,20 +34,9 @@
namespace __scudo {
#if defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32)
-INLINE u32 computeHardwareCRC32(u32 Crc, uptr Data) {
+u32 computeHardwareCRC32(u32 Crc, uptr Data) {
return CRC32_INTRINSIC(Crc, Data);
}
-
-u32 computeCRC32(u32 Crc, uptr Data, u8 HashType) {
- if (HashType == CRC32Hardware) {
- return computeHardwareCRC32(Crc, Data);
- }
- return computeSoftwareCRC32(Crc, Data);
-}
-#else
-u32 computeCRC32(u32 Crc, uptr Data, u8 HashType) {
- return computeSoftwareCRC32(Crc, Data);
-}
#endif // defined(__SSE4_2__) || defined(__ARM_FEATURE_CRC32)
} // namespace __scudo