LLVM  8.0.1
SanitizerStats.h
Go to the documentation of this file.
1 //===- SanitizerStats.h - Sanitizer statistics gathering -------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 //
10 // Declares functions and data structures for sanitizer statistics gathering.
11 //
12 //===----------------------------------------------------------------------===//
13 
14 #ifndef LLVM_TRANSFORMS_UTILS_SANITIZERSTATS_H
15 #define LLVM_TRANSFORMS_UTILS_SANITIZERSTATS_H
16 
17 #include "llvm/IR/IRBuilder.h"
18 
19 namespace llvm {
20 
21 // Number of bits in data that are used for the sanitizer kind. Needs to match
22 // __sanitizer::kKindBits in compiler-rt/lib/stats/stats.h
24 
31 };
32 
35 
36  /// Generates code into B that increments a location-specific counter tagged
37  /// with the given sanitizer kind SK.
39 
40  /// Finalize module stats array and add global constructor to register it.
41  void finish();
42 
43 private:
44  Module *M;
45  GlobalVariable *ModuleStatsGV;
46  ArrayType *StatTy;
47  StructType *EmptyModuleStatsTy;
48 
49  std::vector<Constant *> Inits;
50  ArrayType *makeModuleStatsArrayTy();
51  StructType *makeModuleStatsTy();
52 };
53 
54 }
55 
56 #endif
This class represents lattice values for constants.
Definition: AllocatorList.h:24
A Module instance is used to store all the information related to an LLVM module. ...
Definition: Module.h:65
void create(IRBuilder<> &B, SanitizerStatKind SK)
Generates code into B that increments a location-specific counter tagged with the given sanitizer kin...
Class to represent struct types.
Definition: DerivedTypes.h:201
This provides a uniform API for creating instructions and inserting them into a basic block: either a...
Definition: IRBuilder.h:743
Class to represent array types.
Definition: DerivedTypes.h:369
SanitizerStatKind
static GCRegistry::Add< OcamlGC > B("ocaml", "ocaml 3.10-compatible GC")
void finish()
Finalize module stats array and add global constructor to register it.