diff options
author | Dimitry Andric <dim@FreeBSD.org> | 2015-01-07 19:55:37 +0000 |
---|---|---|
committer | Dimitry Andric <dim@FreeBSD.org> | 2015-01-07 19:55:37 +0000 |
commit | ca9211ecdede9bdedb812b2243a4abdb8dacd1b9 (patch) | |
tree | 9b19e801150082c33e9152275829a6ce90614b55 /lib/profile/InstrProfilingRuntime.cc | |
parent | 8ef50bf3d1c287b5013c3168de77a462dfce3495 (diff) |
Diffstat (limited to 'lib/profile/InstrProfilingRuntime.cc')
-rw-r--r-- | lib/profile/InstrProfilingRuntime.cc | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/lib/profile/InstrProfilingRuntime.cc b/lib/profile/InstrProfilingRuntime.cc new file mode 100644 index 0000000000000..081ecb29e9874 --- /dev/null +++ b/lib/profile/InstrProfilingRuntime.cc @@ -0,0 +1,30 @@ +//===- InstrProfilingRuntime.cpp - PGO runtime initialization -------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is distributed under the University of Illinois Open Source +// License. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +extern "C" { + +#include "InstrProfiling.h" + +__attribute__((visibility("hidden"))) int __llvm_profile_runtime; + +} + +namespace { + +class RegisterRuntime { +public: + RegisterRuntime() { + __llvm_profile_register_write_file_atexit(); + __llvm_profile_initialize_file(); + } +}; + +RegisterRuntime Registration; + +} |