xref: /llvm-project/compiler-rt/lib/ubsan/ubsan_init.h (revision 2946cd701067404b99c39fb29dc9c74bd7193eb3)
16eb53d64SAlexey Samsonov //===-- ubsan_init.h --------------------------------------------*- C++ -*-===//
26eb53d64SAlexey Samsonov //
3*2946cd70SChandler Carruth // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*2946cd70SChandler Carruth // See https://llvm.org/LICENSE.txt for license information.
5*2946cd70SChandler Carruth // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
66eb53d64SAlexey Samsonov //
76eb53d64SAlexey Samsonov //===----------------------------------------------------------------------===//
86eb53d64SAlexey Samsonov //
96eb53d64SAlexey Samsonov // Initialization function for UBSan runtime.
106eb53d64SAlexey Samsonov //
116eb53d64SAlexey Samsonov //===----------------------------------------------------------------------===//
126eb53d64SAlexey Samsonov #ifndef UBSAN_INIT_H
136eb53d64SAlexey Samsonov #define UBSAN_INIT_H
146eb53d64SAlexey Samsonov 
156eb53d64SAlexey Samsonov namespace __ubsan {
166eb53d64SAlexey Samsonov 
172b1eae0aSVedant Kumar // Get the full tool name for UBSan.
182b1eae0aSVedant Kumar const char *GetSanititizerToolName();
192b1eae0aSVedant Kumar 
2009dce3b7SAlexey Samsonov // Initialize UBSan as a standalone tool. Typically should be called early
2109dce3b7SAlexey Samsonov // during initialization.
2209dce3b7SAlexey Samsonov void InitAsStandalone();
2309dce3b7SAlexey Samsonov 
2409dce3b7SAlexey Samsonov // Initialize UBSan as a standalone tool, if it hasn't been initialized before.
2509dce3b7SAlexey Samsonov void InitAsStandaloneIfNecessary();
2609dce3b7SAlexey Samsonov 
2709dce3b7SAlexey Samsonov // Initializes UBSan as a plugin tool. This function should be called once
2809dce3b7SAlexey Samsonov // from "parent tool" (e.g. ASan) initialization.
2909dce3b7SAlexey Samsonov void InitAsPlugin();
306eb53d64SAlexey Samsonov 
316eb53d64SAlexey Samsonov }  // namespace __ubsan
326eb53d64SAlexey Samsonov 
336eb53d64SAlexey Samsonov #endif  // UBSAN_INIT_H
34