Path: blob/main/contrib/llvm-project/compiler-rt/lib/stats/stats.h
35262 views
//===-- stats.h -------------------------------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//7//8// Data definitions for sanitizer statistics gathering.9//10//===----------------------------------------------------------------------===//1112#ifndef SANITIZER_STATS_STATS_H13#define SANITIZER_STATS_STATS_H1415#include "sanitizer_common/sanitizer_internal_defs.h"1617namespace __sanitizer {1819// Number of bits in data that are used for the sanitizer kind. Needs to match20// llvm::kSanitizerStatKindBits in21// llvm/include/llvm/Transforms/Utils/SanitizerStats.h22enum { kKindBits = 3 };2324struct StatInfo {25uptr addr;26uptr data;27};2829struct StatModule {30StatModule *next;31u32 size;32StatInfo infos[1];33};3435inline uptr CountFromData(uptr data) {36return data & ((1ull << (sizeof(uptr) * 8 - kKindBits)) - 1);37}3839}4041#endif424344