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