1 1.1 joerg //===-- stats.h -------------------------------------------------*- C++ -*-===// 2 1.1 joerg // 3 1.1 joerg // The LLVM Compiler Infrastructure 4 1.1 joerg // 5 1.1 joerg // This file is distributed under the University of Illinois Open Source 6 1.1 joerg // License. See LICENSE.TXT for details. 7 1.1 joerg // 8 1.1 joerg //===----------------------------------------------------------------------===// 9 1.1 joerg // 10 1.1 joerg // Data definitions for sanitizer statistics gathering. 11 1.1 joerg // 12 1.1 joerg //===----------------------------------------------------------------------===// 13 1.1 joerg 14 1.1 joerg #ifndef SANITIZER_STATS_STATS_H 15 1.1 joerg #define SANITIZER_STATS_STATS_H 16 1.1 joerg 17 1.1 joerg #include "sanitizer_common/sanitizer_internal_defs.h" 18 1.1 joerg 19 1.1 joerg namespace __sanitizer { 20 1.1 joerg 21 1.1 joerg // Number of bits in data that are used for the sanitizer kind. Needs to match 22 1.1 joerg // llvm::kSanitizerStatKindBits in 23 1.1 joerg // llvm/include/llvm/Transforms/Utils/SanitizerStats.h 24 1.1 joerg enum { kKindBits = 3 }; 25 1.1 joerg 26 1.1 joerg struct StatInfo { 27 1.1 joerg uptr addr; 28 1.1 joerg uptr data; 29 1.1 joerg }; 30 1.1 joerg 31 1.1 joerg struct StatModule { 32 1.1 joerg StatModule *next; 33 1.1 joerg u32 size; 34 1.1 joerg StatInfo infos[1]; 35 1.1 joerg }; 36 1.1 joerg 37 1.1 joerg inline uptr CountFromData(uptr data) { 38 1.1 joerg return data & ((1ull << (sizeof(uptr) * 8 - kKindBits)) - 1); 39 1.1 joerg } 40 1.1 joerg 41 1.1 joerg } 42 1.1 joerg 43 1.1 joerg #endif 44