13cab2bb3Spatrick //===- InstrProfilingRuntime.cpp - PGO runtime initialization -------------===// 23cab2bb3Spatrick // 33cab2bb3Spatrick // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 43cab2bb3Spatrick // See https://llvm.org/LICENSE.txt for license information. 53cab2bb3Spatrick // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 63cab2bb3Spatrick // 73cab2bb3Spatrick //===----------------------------------------------------------------------===// 83cab2bb3Spatrick 93cab2bb3Spatrick extern "C" { 103cab2bb3Spatrick 113cab2bb3Spatrick #include "InstrProfiling.h" 123cab2bb3Spatrick RegisterRuntime()13*810390e3Srobertstatic int RegisterRuntime() { 141f9cb04fSpatrick __llvm_profile_initialize(); 15*810390e3Srobert #ifdef _AIX 16*810390e3Srobert extern COMPILER_RT_VISIBILITY void *__llvm_profile_keep[]; 17*810390e3Srobert (void)*(void *volatile *)__llvm_profile_keep; 18*810390e3Srobert #endif 19*810390e3Srobert return 0; 203cab2bb3Spatrick } 213cab2bb3Spatrick 22*810390e3Srobert /* int __llvm_profile_runtime */ 23*810390e3Srobert COMPILER_RT_VISIBILITY int INSTR_PROF_PROFILE_RUNTIME_VAR = RegisterRuntime(); 243cab2bb3Spatrick } 25