xref: /freebsd-src/contrib/llvm-project/compiler-rt/lib/profile/InstrProfilingRuntime.cpp (revision 68d75eff68281c1b445e3010bb975eae07aac225)
1*68d75effSDimitry Andric //===- InstrProfilingRuntime.cpp - PGO runtime initialization -------------===//
2*68d75effSDimitry Andric //
3*68d75effSDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4*68d75effSDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5*68d75effSDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6*68d75effSDimitry Andric //
7*68d75effSDimitry Andric //===----------------------------------------------------------------------===//
8*68d75effSDimitry Andric 
9*68d75effSDimitry Andric extern "C" {
10*68d75effSDimitry Andric 
11*68d75effSDimitry Andric #include "InstrProfiling.h"
12*68d75effSDimitry Andric 
13*68d75effSDimitry Andric /* int __llvm_profile_runtime  */
14*68d75effSDimitry Andric COMPILER_RT_VISIBILITY int INSTR_PROF_PROFILE_RUNTIME_VAR;
15*68d75effSDimitry Andric }
16*68d75effSDimitry Andric 
17*68d75effSDimitry Andric namespace {
18*68d75effSDimitry Andric 
19*68d75effSDimitry Andric class RegisterRuntime {
20*68d75effSDimitry Andric public:
21*68d75effSDimitry Andric   RegisterRuntime() {
22*68d75effSDimitry Andric     __llvm_profile_register_write_file_atexit();
23*68d75effSDimitry Andric     __llvm_profile_initialize_file();
24*68d75effSDimitry Andric   }
25*68d75effSDimitry Andric };
26*68d75effSDimitry Andric 
27*68d75effSDimitry Andric RegisterRuntime Registration;
28*68d75effSDimitry Andric 
29*68d75effSDimitry Andric }
30