LLVM  14.0.0git
SanitizerStats.h
Go to the documentation of this file.
1 //===- SanitizerStats.h - Sanitizer statistics gathering -------*- 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 // Declares functions and data structures for sanitizer statistics gathering.
10 //
11 //===----------------------------------------------------------------------===//
12 
13 #ifndef LLVM_TRANSFORMS_UTILS_SANITIZERSTATS_H
14 #define LLVM_TRANSFORMS_UTILS_SANITIZERSTATS_H
15 
16 #include "llvm/IR/IRBuilder.h"
17 
18 namespace llvm {
19 
20 // Number of bits in data that are used for the sanitizer kind. Needs to match
21 // __sanitizer::kKindBits in compiler-rt/lib/stats/stats.h
23 
30 };
31 
34 
35  /// Generates code into B that increments a location-specific counter tagged
36  /// with the given sanitizer kind SK.
38 
39  /// Finalize module stats array and add global constructor to register it.
40  void finish();
41 
42 private:
43  Module *M;
44  GlobalVariable *ModuleStatsGV;
45  ArrayType *StatTy;
46  StructType *EmptyModuleStatsTy;
47 
48  std::vector<Constant *> Inits;
49  ArrayType *makeModuleStatsArrayTy();
50  StructType *makeModuleStatsTy();
51 };
52 
53 }
54 
55 #endif
llvm
This file implements support for optimizing divisions by a constant.
Definition: AllocatorList.h:23
M
We currently emits eax Perhaps this is what we really should generate is Is imull three or four cycles eax eax The current instruction priority is based on pattern complexity The former is more complex because it folds a load so the latter will not be emitted Perhaps we should use AddedComplexity to give LEA32r a higher priority We should always try to match LEA first since the LEA matching code does some estimate to determine whether the match is profitable if we care more about code then imull is better It s two bytes shorter than movl leal On a Pentium M
Definition: README.txt:252
llvm::kSanitizerStatKindBits
@ kSanitizerStatKindBits
Definition: SanitizerStats.h:22
llvm::SanStat_CFI_ICall
@ SanStat_CFI_ICall
Definition: SanitizerStats.h:29
llvm::IRBuilder<>
llvm::GlobalVariable
Definition: GlobalVariable.h:40
llvm::ArrayType
Class to represent array types.
Definition: DerivedTypes.h:357
B
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
llvm::SanStat_CFI_UnrelatedCast
@ SanStat_CFI_UnrelatedCast
Definition: SanitizerStats.h:28
llvm::SanitizerStatReport::finish
void finish()
Finalize module stats array and add global constructor to register it.
Definition: SanitizerStats.cpp:71
llvm::SanStat_CFI_VCall
@ SanStat_CFI_VCall
Definition: SanitizerStats.h:25
llvm::SanitizerStatKind
SanitizerStatKind
Definition: SanitizerStats.h:24
IRBuilder.h
llvm::Module
A Module instance is used to store all the information related to an LLVM module.
Definition: Module.h:67
llvm::StructType
Class to represent struct types.
Definition: DerivedTypes.h:213
llvm::SanitizerStatReport
Definition: SanitizerStats.h:32
llvm::SanStat_CFI_DerivedCast
@ SanStat_CFI_DerivedCast
Definition: SanitizerStats.h:27
llvm::SanStat_CFI_NVCall
@ SanStat_CFI_NVCall
Definition: SanitizerStats.h:26
llvm::SanitizerStatReport::create
void create(IRBuilder<> &B, SanitizerStatKind SK)
Generates code into B that increments a location-specific counter tagged with the given sanitizer kin...
Definition: SanitizerStats.cpp:42
llvm::SanitizerStatReport::SanitizerStatReport
SanitizerStatReport(Module *M)
Definition: SanitizerStats.cpp:24