blob: 081ecb29e9874011622100484e49204ae229ea0b [file] [log] [blame]
Duncan P. N. Exon Smith775c178a2014-03-20 19:23:53 +00001//===- 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
10extern "C" {
11
Duncan P. N. Exon Smithbe0a5e12014-03-21 18:29:15 +000012#include "InstrProfiling.h"
Duncan P. N. Exon Smith775c178a2014-03-20 19:23:53 +000013
Duncan P. N. Exon Smith08439882014-05-16 01:30:24 +000014__attribute__((visibility("hidden"))) int __llvm_profile_runtime;
Duncan P. N. Exon Smith775c178a2014-03-20 19:23:53 +000015
16}
17
18namespace {
19
Duncan P. N. Exon Smith08439882014-05-16 01:30:24 +000020class RegisterRuntime {
Duncan P. N. Exon Smith775c178a2014-03-20 19:23:53 +000021public:
Duncan P. N. Exon Smith08439882014-05-16 01:30:24 +000022 RegisterRuntime() {
23 __llvm_profile_register_write_file_atexit();
Duncan P. N. Exon Smith55e4d662014-05-17 01:27:30 +000024 __llvm_profile_initialize_file();
Duncan P. N. Exon Smith08439882014-05-16 01:30:24 +000025 }
Duncan P. N. Exon Smith775c178a2014-03-20 19:23:53 +000026};
27
Duncan P. N. Exon Smith08439882014-05-16 01:30:24 +000028RegisterRuntime Registration;
Duncan P. N. Exon Smith775c178a2014-03-20 19:23:53 +000029
30}