[flang][cuda] Adapt ExternalNameConversion to work in gpu module (#117039)
[llvm-project.git] / compiler-rt / lib / stats / stats.h
blob4b7514d6108291d0c22d1188a83f6f3fa903f8a1
1 //===-- stats.h -------------------------------------------------*- C++ -*-===//
2 //
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
6 //
7 //===----------------------------------------------------------------------===//
8 //
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 };
25 struct StatInfo {
26 uptr addr;
27 uptr data;
30 struct StatModule {
31 StatModule *next;
32 u32 size;
33 StatInfo infos[1];
36 inline uptr CountFromData(uptr data) {
37 return data & ((1ull << (sizeof(uptr) * 8 - kKindBits)) - 1);
42 #endif