]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - contrib/compiler-rt/lib/profile/InstrProfilingRuntime.cc
Merge compiler-rt trunk r366426, resolve conflicts, and add
[FreeBSD/FreeBSD.git] / contrib / compiler-rt / lib / profile / InstrProfilingRuntime.cc
1 //===- InstrProfilingRuntime.cpp - PGO runtime initialization -------------===//
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 extern "C" {
10
11 #include "InstrProfiling.h"
12
13 /* int __llvm_profile_runtime  */
14 COMPILER_RT_VISIBILITY int INSTR_PROF_PROFILE_RUNTIME_VAR;
15 }
16
17 namespace {
18
19 class RegisterRuntime {
20 public:
21   RegisterRuntime() {
22     __llvm_profile_register_write_file_atexit();
23     __llvm_profile_initialize_file();
24   }
25 };
26
27 RegisterRuntime Registration;
28
29 }