InstrProfilingRuntime.cpp 733 B

123456789101112131415161718192021222324
  1. //===- InstrProfilingRuntime.cpp - PGO runtime initialization -------------===//
  2. //
  3. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  4. // See https://llvm.org/LICENSE.txt for license information.
  5. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. extern "C" {
  9. #include "InstrProfiling.h"
  10. static int RegisterRuntime() {
  11. __llvm_profile_initialize();
  12. #ifdef _AIX
  13. extern COMPILER_RT_VISIBILITY void *__llvm_profile_keep[];
  14. (void)*(void *volatile *)__llvm_profile_keep;
  15. #endif
  16. return 0;
  17. }
  18. /* int __llvm_profile_runtime */
  19. COMPILER_RT_VISIBILITY int INSTR_PROF_PROFILE_RUNTIME_VAR = RegisterRuntime();
  20. }