1*0a6a1f1dSLionel Sambuc //===- InstrProfilingRuntime.cpp - PGO runtime initialization -------------===// 2*0a6a1f1dSLionel Sambuc // 3*0a6a1f1dSLionel Sambuc // The LLVM Compiler Infrastructure 4*0a6a1f1dSLionel Sambuc // 5*0a6a1f1dSLionel Sambuc // This file is distributed under the University of Illinois Open Source 6*0a6a1f1dSLionel Sambuc // License. See LICENSE.TXT for details. 7*0a6a1f1dSLionel Sambuc // 8*0a6a1f1dSLionel Sambuc //===----------------------------------------------------------------------===// 9*0a6a1f1dSLionel Sambuc 10*0a6a1f1dSLionel Sambuc extern "C" { 11*0a6a1f1dSLionel Sambuc 12*0a6a1f1dSLionel Sambuc #include "InstrProfiling.h" 13*0a6a1f1dSLionel Sambuc 14*0a6a1f1dSLionel Sambuc __attribute__((visibility("hidden"))) int __llvm_profile_runtime; 15*0a6a1f1dSLionel Sambuc 16*0a6a1f1dSLionel Sambuc } 17*0a6a1f1dSLionel Sambuc 18*0a6a1f1dSLionel Sambuc namespace { 19*0a6a1f1dSLionel Sambuc 20*0a6a1f1dSLionel Sambuc class RegisterRuntime { 21*0a6a1f1dSLionel Sambuc public: RegisterRuntime()22*0a6a1f1dSLionel Sambuc RegisterRuntime() { 23*0a6a1f1dSLionel Sambuc __llvm_profile_register_write_file_atexit(); 24*0a6a1f1dSLionel Sambuc __llvm_profile_initialize_file(); 25*0a6a1f1dSLionel Sambuc } 26*0a6a1f1dSLionel Sambuc }; 27*0a6a1f1dSLionel Sambuc 28*0a6a1f1dSLionel Sambuc RegisterRuntime Registration; 29*0a6a1f1dSLionel Sambuc 30*0a6a1f1dSLionel Sambuc } 31