xref: /aosp_15_r20/external/compiler-rt/lib/profile/InstrProfilingRuntime.cc (revision 7c3d14c8b49c529e04be81a3ce6f5cc23712e4c6)
1*7c3d14c8STreehugger Robot //===- InstrProfilingRuntime.cpp - PGO runtime initialization -------------===//
2*7c3d14c8STreehugger Robot //
3*7c3d14c8STreehugger Robot //                     The LLVM Compiler Infrastructure
4*7c3d14c8STreehugger Robot //
5*7c3d14c8STreehugger Robot // This file is distributed under the University of Illinois Open Source
6*7c3d14c8STreehugger Robot // License. See LICENSE.TXT for details.
7*7c3d14c8STreehugger Robot //
8*7c3d14c8STreehugger Robot //===----------------------------------------------------------------------===//
9*7c3d14c8STreehugger Robot 
10*7c3d14c8STreehugger Robot extern "C" {
11*7c3d14c8STreehugger Robot 
12*7c3d14c8STreehugger Robot #include "InstrProfiling.h"
13*7c3d14c8STreehugger Robot 
14*7c3d14c8STreehugger Robot COMPILER_RT_VISIBILITY int __llvm_profile_runtime;
15*7c3d14c8STreehugger Robot }
16*7c3d14c8STreehugger Robot 
17*7c3d14c8STreehugger Robot namespace {
18*7c3d14c8STreehugger Robot 
19*7c3d14c8STreehugger Robot class RegisterRuntime {
20*7c3d14c8STreehugger Robot public:
RegisterRuntime()21*7c3d14c8STreehugger Robot   RegisterRuntime() {
22*7c3d14c8STreehugger Robot     __llvm_profile_register_write_file_atexit();
23*7c3d14c8STreehugger Robot     __llvm_profile_initialize_file();
24*7c3d14c8STreehugger Robot   }
25*7c3d14c8STreehugger Robot };
26*7c3d14c8STreehugger Robot 
27*7c3d14c8STreehugger Robot RegisterRuntime Registration;
28*7c3d14c8STreehugger Robot 
29*7c3d14c8STreehugger Robot }
30