[clang] Handle __declspec() attributes in using
[llvm-project.git] / compiler-rt / lib / memprof / memprof_preinit.cpp
blob7092cd4ee55648026c28ef90dac2a95d9bfbcfa6
1 //===-- memprof_preinit.cpp ----------------------------------------------===//
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 //
9 // This file is a part of MemProfiler, a memory profiler.
11 // Call __memprof_init at the very early stage of process startup.
12 //===----------------------------------------------------------------------===//
13 #include "memprof_internal.h"
15 using namespace __memprof;
17 #if SANITIZER_CAN_USE_PREINIT_ARRAY
18 // The symbol is called __local_memprof_preinit, because it's not intended to
19 // be exported. This code linked into the main executable when -fmemory-profile
20 // is in the link flags. It can only use exported interface functions.
21 __attribute__((section(".preinit_array"),
22 used)) void (*__local_memprof_preinit)(void) = __memprof_preinit;
23 #endif