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