Duncan P. N. Exon Smith | 775c178a | 2014-03-20 19:23:53 +0000 | [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 | |
Duncan P. N. Exon Smith | be0a5e1 | 2014-03-21 18:29:15 +0000 | [diff] [blame] | 12 | #include "InstrProfiling.h" |
Duncan P. N. Exon Smith | 775c178a | 2014-03-20 19:23:53 +0000 | [diff] [blame] | 13 | |
Duncan P. N. Exon Smith | 0843988 | 2014-05-16 01:30:24 +0000 | [diff] [blame] | 14 | __attribute__((visibility("hidden"))) int __llvm_profile_runtime; |
Duncan P. N. Exon Smith | 775c178a | 2014-03-20 19:23:53 +0000 | [diff] [blame] | 15 | |
| 16 | } |
| 17 | |
| 18 | namespace { |
| 19 | |
Duncan P. N. Exon Smith | 0843988 | 2014-05-16 01:30:24 +0000 | [diff] [blame] | 20 | class RegisterRuntime { |
Duncan P. N. Exon Smith | 775c178a | 2014-03-20 19:23:53 +0000 | [diff] [blame] | 21 | public: |
Duncan P. N. Exon Smith | 0843988 | 2014-05-16 01:30:24 +0000 | [diff] [blame] | 22 | RegisterRuntime() { |
| 23 | __llvm_profile_register_write_file_atexit(); |
Duncan P. N. Exon Smith | 55e4d66 | 2014-05-17 01:27:30 +0000 | [diff] [blame^] | 24 | __llvm_profile_initialize_file(); |
Duncan P. N. Exon Smith | 0843988 | 2014-05-16 01:30:24 +0000 | [diff] [blame] | 25 | } |
Duncan P. N. Exon Smith | 775c178a | 2014-03-20 19:23:53 +0000 | [diff] [blame] | 26 | }; |
| 27 | |
Duncan P. N. Exon Smith | 0843988 | 2014-05-16 01:30:24 +0000 | [diff] [blame] | 28 | RegisterRuntime Registration; |
Duncan P. N. Exon Smith | 775c178a | 2014-03-20 19:23:53 +0000 | [diff] [blame] | 29 | |
| 30 | } |