xref: /freebsd-src/contrib/llvm-project/compiler-rt/lib/profile/InstrProfilingInternal.c (revision 81ad626541db97eb356e2c1d4a20eb2a26a766ab)
15ffd83dbSDimitry Andric /*===- InstrProfilingInternal.c - Support library for PGO instrumentation -===*\
25ffd83dbSDimitry Andric |*
35ffd83dbSDimitry Andric |* Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
45ffd83dbSDimitry Andric |* See https://llvm.org/LICENSE.txt for license information.
55ffd83dbSDimitry Andric |* SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
65ffd83dbSDimitry Andric |*
75ffd83dbSDimitry Andric \*===----------------------------------------------------------------------===*/
85ffd83dbSDimitry Andric 
9e8d8bef9SDimitry Andric // Note: This is linked into the Darwin kernel, and must remain compatible
10e8d8bef9SDimitry Andric // with freestanding compilation. See `darwin_add_builtin_libraries`.
11e8d8bef9SDimitry Andric 
125ffd83dbSDimitry Andric #if !defined(__Fuchsia__)
135ffd83dbSDimitry Andric 
145ffd83dbSDimitry Andric #include "InstrProfilingInternal.h"
155ffd83dbSDimitry Andric 
165ffd83dbSDimitry Andric static unsigned ProfileDumped = 0;
175ffd83dbSDimitry Andric 
lprofProfileDumped(void)18*81ad6265SDimitry Andric COMPILER_RT_VISIBILITY unsigned lprofProfileDumped(void) {
195ffd83dbSDimitry Andric   return ProfileDumped;
205ffd83dbSDimitry Andric }
215ffd83dbSDimitry Andric 
lprofSetProfileDumped(unsigned Value)225ffd83dbSDimitry Andric COMPILER_RT_VISIBILITY void lprofSetProfileDumped(unsigned Value) {
235ffd83dbSDimitry Andric   ProfileDumped = Value;
245ffd83dbSDimitry Andric }
255ffd83dbSDimitry Andric 
265ffd83dbSDimitry Andric #endif
27