1//===- ClangTidyForceLinker.h - clang-tidy --------------------------------===//
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#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYFORCELINKER_H
10#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYFORCELINKER_H
11
12#include "clang-tidy-config.h"
13#include "llvm/Support/Compiler.h"
14
15namespace clang::tidy {
16
17// This anchor is used to force the linker to link the AbseilModule.
18extern volatile int AbseilModuleAnchorSource;
19static int LLVM_ATTRIBUTE_UNUSED AbseilModuleAnchorDestination =
20 AbseilModuleAnchorSource;
21
22// This anchor is used to force the linker to link the AlteraModule.
23extern volatile int AlteraModuleAnchorSource;
24static int LLVM_ATTRIBUTE_UNUSED AlteraModuleAnchorDestination =
25 AlteraModuleAnchorSource;
26
27// This anchor is used to force the linker to link the AndroidModule.
28extern volatile int AndroidModuleAnchorSource;
29static int LLVM_ATTRIBUTE_UNUSED AndroidModuleAnchorDestination =
30 AndroidModuleAnchorSource;
31
32// This anchor is used to force the linker to link the BoostModule.
33extern volatile int BoostModuleAnchorSource;
34static int LLVM_ATTRIBUTE_UNUSED BoostModuleAnchorDestination =
35 BoostModuleAnchorSource;
36
37// This anchor is used to force the linker to link the BugproneModule.
38extern volatile int BugproneModuleAnchorSource;
39static int LLVM_ATTRIBUTE_UNUSED BugproneModuleAnchorDestination =
40 BugproneModuleAnchorSource;
41
42// This anchor is used to force the linker to link the CERTModule.
43extern volatile int CERTModuleAnchorSource;
44static int LLVM_ATTRIBUTE_UNUSED CERTModuleAnchorDestination =
45 CERTModuleAnchorSource;
46
47// This anchor is used to force the linker to link the ConcurrencyModule.
48extern volatile int ConcurrencyModuleAnchorSource;
49static int LLVM_ATTRIBUTE_UNUSED ConcurrencyModuleAnchorDestination =
50 ConcurrencyModuleAnchorSource;
51
52// This anchor is used to force the linker to link the CppCoreGuidelinesModule.
53extern volatile int CppCoreGuidelinesModuleAnchorSource;
54static int LLVM_ATTRIBUTE_UNUSED CppCoreGuidelinesModuleAnchorDestination =
55 CppCoreGuidelinesModuleAnchorSource;
56
57// This anchor is used to force the linker to link the DarwinModule.
58extern volatile int DarwinModuleAnchorSource;
59static int LLVM_ATTRIBUTE_UNUSED DarwinModuleAnchorDestination =
60 DarwinModuleAnchorSource;
61
62// This anchor is used to force the linker to link the FuchsiaModule.
63extern volatile int FuchsiaModuleAnchorSource;
64static int LLVM_ATTRIBUTE_UNUSED FuchsiaModuleAnchorDestination =
65 FuchsiaModuleAnchorSource;
66
67// This anchor is used to force the linker to link the GoogleModule.
68extern volatile int GoogleModuleAnchorSource;
69static int LLVM_ATTRIBUTE_UNUSED GoogleModuleAnchorDestination =
70 GoogleModuleAnchorSource;
71
72// This anchor is used to force the linker to link the HICPPModule.
73extern volatile int HICPPModuleAnchorSource;
74static int LLVM_ATTRIBUTE_UNUSED HICPPModuleAnchorDestination =
75 HICPPModuleAnchorSource;
76
77// This anchor is used to force the linker to link the LinuxKernelModule.
78extern volatile int LinuxKernelModuleAnchorSource;
79static int LLVM_ATTRIBUTE_UNUSED LinuxKernelModuleAnchorDestination =
80 LinuxKernelModuleAnchorSource;
81
82// This anchor is used to force the linker to link the LLVMModule.
83extern volatile int LLVMModuleAnchorSource;
84static int LLVM_ATTRIBUTE_UNUSED LLVMModuleAnchorDestination =
85 LLVMModuleAnchorSource;
86
87// This anchor is used to force the linker to link the LLVMLibcModule.
88extern volatile int LLVMLibcModuleAnchorSource;
89static int LLVM_ATTRIBUTE_UNUSED LLVMLibcModuleAnchorDestination =
90 LLVMLibcModuleAnchorSource;
91
92// This anchor is used to force the linker to link the MiscModule.
93extern volatile int MiscModuleAnchorSource;
94static int LLVM_ATTRIBUTE_UNUSED MiscModuleAnchorDestination =
95 MiscModuleAnchorSource;
96
97// This anchor is used to force the linker to link the ModernizeModule.
98extern volatile int ModernizeModuleAnchorSource;
99static int LLVM_ATTRIBUTE_UNUSED ModernizeModuleAnchorDestination =
100 ModernizeModuleAnchorSource;
101
102#if CLANG_TIDY_ENABLE_STATIC_ANALYZER && \
103 !defined(CLANG_TIDY_DISABLE_STATIC_ANALYZER_CHECKS)
104// This anchor is used to force the linker to link the MPIModule.
105extern volatile int MPIModuleAnchorSource;
106static int LLVM_ATTRIBUTE_UNUSED MPIModuleAnchorDestination =
107 MPIModuleAnchorSource;
108#endif
109
110// This anchor is used to force the linker to link the ObjCModule.
111extern volatile int ObjCModuleAnchorSource;
112static int LLVM_ATTRIBUTE_UNUSED ObjCModuleAnchorDestination =
113 ObjCModuleAnchorSource;
114
115// This anchor is used to force the linker to link the OpenMPModule.
116extern volatile int OpenMPModuleAnchorSource;
117static int LLVM_ATTRIBUTE_UNUSED OpenMPModuleAnchorDestination =
118 OpenMPModuleAnchorSource;
119
120// This anchor is used to force the linker to link the PerformanceModule.
121extern volatile int PerformanceModuleAnchorSource;
122static int LLVM_ATTRIBUTE_UNUSED PerformanceModuleAnchorDestination =
123 PerformanceModuleAnchorSource;
124
125// This anchor is used to force the linker to link the PortabilityModule.
126extern volatile int PortabilityModuleAnchorSource;
127static int LLVM_ATTRIBUTE_UNUSED PortabilityModuleAnchorDestination =
128 PortabilityModuleAnchorSource;
129
130// This anchor is used to force the linker to link the ReadabilityModule.
131extern volatile int ReadabilityModuleAnchorSource;
132static int LLVM_ATTRIBUTE_UNUSED ReadabilityModuleAnchorDestination =
133 ReadabilityModuleAnchorSource;
134
135// This anchor is used to force the linker to link the ZirconModule.
136extern volatile int ZirconModuleAnchorSource;
137static int LLVM_ATTRIBUTE_UNUSED ZirconModuleAnchorDestination =
138 ZirconModuleAnchorSource;
139
140} // namespace clang::tidy
141
142#endif
143

source code of clang-tools-extra/clang-tidy/ClangTidyForceLinker.h