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 | |
| 12 | #include "InstrProfilingExtras.h" |
| 13 | |
Duncan P. N. Exon Smith | 9edbae0 | 2014-03-20 20:00:44 +0000 | [diff] [blame^] | 14 | extern int __llvm_profile_runtime; |
| 15 | int __llvm_profile_runtime; |
Duncan P. N. Exon Smith | 775c178a | 2014-03-20 19:23:53 +0000 | [diff] [blame] | 16 | |
| 17 | } |
| 18 | |
| 19 | namespace { |
| 20 | |
| 21 | class RegisterAtExit { |
| 22 | public: |
Duncan P. N. Exon Smith | 9edbae0 | 2014-03-20 20:00:44 +0000 | [diff] [blame^] | 23 | RegisterAtExit() { __llvm_profile_register_write_file_atexit(); } |
Duncan P. N. Exon Smith | 775c178a | 2014-03-20 19:23:53 +0000 | [diff] [blame] | 24 | }; |
| 25 | |
| 26 | RegisterAtExit Registration; |
| 27 | |
| 28 | } |