Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 1 | //===- InstrProfilingRuntime.cpp - PGO runtime initialization -------------===// |
| 2 | // |
| 3 | // The LLVM Compiler Infrastructure |
| 4 | // |
| 5 | // This file is distributed under the University of Illinois Open Source |
| 6 | // License. See LICENSE.TXT for details. |
| 7 | // |
| 8 | //===----------------------------------------------------------------------===// |
| 9 | |
| 10 | extern "C" { |
| 11 | |
| 12 | #include "InstrProfiling.h" |
| 13 | |
Pirama Arumuga Nainar | 799172d | 2016-03-03 15:50:30 -0800 | [diff] [blame^] | 14 | COMPILER_RT_VISIBILITY int __llvm_profile_runtime; |
Stephen Hines | 2d1fdb2 | 2014-05-28 23:58:16 -0700 | [diff] [blame] | 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 | } |