xref: /freebsd/contrib/llvm-project/compiler-rt/lib/ubsan/ubsan_init.h (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1 //===-- ubsan_init.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 // Initialization function for UBSan runtime.
10 //
11 //===----------------------------------------------------------------------===//
12 #ifndef UBSAN_INIT_H
13 #define UBSAN_INIT_H
14 
15 namespace __ubsan {
16 
17 // Get the full tool name for UBSan.
18 const char *GetSanititizerToolName();
19 
20 // Initialize UBSan as a standalone tool. Typically should be called early
21 // during initialization.
22 void InitAsStandalone();
23 
24 // Initialize UBSan as a standalone tool, if it hasn't been initialized before.
25 void InitAsStandaloneIfNecessary();
26 
27 // Initializes UBSan as a plugin tool. This function should be called once
28 // from "parent tool" (e.g. ASan) initialization.
29 void InitAsPlugin();
30 
31 }  // namespace __ubsan
32 
33 #endif  // UBSAN_INIT_H
34