1 //===-- stats.h -------------------------------------------------*- C++ -*-===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 // Data definitions for sanitizer statistics gathering.
12 //===----------------------------------------------------------------------===//
14 #ifndef SANITIZER_STATS_STATS_H
15 #define SANITIZER_STATS_STATS_H
17 #include "sanitizer_common/sanitizer_internal_defs.h"
19 namespace __sanitizer {
21 // Number of bits in data that are used for the sanitizer kind. Needs to match
22 // llvm::kSanitizerStatKindBits in
23 // llvm/include/llvm/Transforms/Utils/SanitizerStats.h
24 enum { kKindBits = 3 };
37 inline uptr CountFromData(uptr data) {
38 return data & ((1ull << (sizeof(uptr) * 8 - kKindBits)) - 1);