1 //===-- stats.h -------------------------------------------------*- C++ -*-===//
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
9 // Data definitions for sanitizer statistics gathering.
11 //===----------------------------------------------------------------------===//
13 #ifndef SANITIZER_STATS_STATS_H
14 #define SANITIZER_STATS_STATS_H
16 #include "sanitizer_common/sanitizer_internal_defs.h"
18 namespace __sanitizer
{
20 // Number of bits in data that are used for the sanitizer kind. Needs to match
21 // llvm::kSanitizerStatKindBits in
22 // llvm/include/llvm/Transforms/Utils/SanitizerStats.h
23 enum { kKindBits
= 3 };
36 inline uptr
CountFromData(uptr data
) {
37 return data
& ((1ull << (sizeof(uptr
) * 8 - kKindBits
)) - 1);