clang-tools 22.0.0git
ClangTidyForceLinker.h
Go to the documentation of this file.
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 =
21
22// This anchor is used to force the linker to link the AlteraModule.
23extern volatile int AlteraModuleAnchorSource;
24static int LLVM_ATTRIBUTE_UNUSED AlteraModuleAnchorDestination =
26
27// This anchor is used to force the linker to link the AndroidModule.
28extern volatile int AndroidModuleAnchorSource;
29static int LLVM_ATTRIBUTE_UNUSED AndroidModuleAnchorDestination =
31
32// This anchor is used to force the linker to link the BoostModule.
33extern volatile int BoostModuleAnchorSource;
34static int LLVM_ATTRIBUTE_UNUSED BoostModuleAnchorDestination =
36
37// This anchor is used to force the linker to link the BugproneModule.
38extern volatile int BugproneModuleAnchorSource;
39static int LLVM_ATTRIBUTE_UNUSED BugproneModuleAnchorDestination =
41
42// This anchor is used to force the linker to link the CERTModule.
43extern volatile int CERTModuleAnchorSource;
44static int LLVM_ATTRIBUTE_UNUSED CERTModuleAnchorDestination =
46
47// This anchor is used to force the linker to link the ConcurrencyModule.
48extern volatile int ConcurrencyModuleAnchorSource;
49static int LLVM_ATTRIBUTE_UNUSED ConcurrencyModuleAnchorDestination =
51
52// This anchor is used to force the linker to link the CppCoreGuidelinesModule.
53extern volatile int CppCoreGuidelinesModuleAnchorSource;
54static int LLVM_ATTRIBUTE_UNUSED CppCoreGuidelinesModuleAnchorDestination =
56
57#if CLANG_TIDY_ENABLE_QUERY_BASED_CUSTOM_CHECKS
58// This anchor is used to force the linker to link the CustomModule.
59extern volatile int CustomModuleAnchorSource;
60static int LLVM_ATTRIBUTE_UNUSED CustomModuleAnchorDestination =
62#endif
63
64// This anchor is used to force the linker to link the DarwinModule.
65extern volatile int DarwinModuleAnchorSource;
66static int LLVM_ATTRIBUTE_UNUSED DarwinModuleAnchorDestination =
68
69// This anchor is used to force the linker to link the FuchsiaModule.
70extern volatile int FuchsiaModuleAnchorSource;
71static int LLVM_ATTRIBUTE_UNUSED FuchsiaModuleAnchorDestination =
73
74// This anchor is used to force the linker to link the GoogleModule.
75extern volatile int GoogleModuleAnchorSource;
76static int LLVM_ATTRIBUTE_UNUSED GoogleModuleAnchorDestination =
78
79// This anchor is used to force the linker to link the HICPPModule.
80extern volatile int HICPPModuleAnchorSource;
81static int LLVM_ATTRIBUTE_UNUSED HICPPModuleAnchorDestination =
83
84// This anchor is used to force the linker to link the LinuxKernelModule.
85extern volatile int LinuxKernelModuleAnchorSource;
86static int LLVM_ATTRIBUTE_UNUSED LinuxKernelModuleAnchorDestination =
88
89// This anchor is used to force the linker to link the LLVMModule.
90extern volatile int LLVMModuleAnchorSource;
91static int LLVM_ATTRIBUTE_UNUSED LLVMModuleAnchorDestination =
93
94// This anchor is used to force the linker to link the LLVMLibcModule.
95extern volatile int LLVMLibcModuleAnchorSource;
96static int LLVM_ATTRIBUTE_UNUSED LLVMLibcModuleAnchorDestination =
98
99// This anchor is used to force the linker to link the MiscModule.
100extern volatile int MiscModuleAnchorSource;
101static int LLVM_ATTRIBUTE_UNUSED MiscModuleAnchorDestination =
103
104// This anchor is used to force the linker to link the ModernizeModule.
105extern volatile int ModernizeModuleAnchorSource;
106static int LLVM_ATTRIBUTE_UNUSED ModernizeModuleAnchorDestination =
108
109#if CLANG_TIDY_ENABLE_STATIC_ANALYZER && \
110 !defined(CLANG_TIDY_DISABLE_STATIC_ANALYZER_CHECKS)
111// This anchor is used to force the linker to link the MPIModule.
112extern volatile int MPIModuleAnchorSource;
113static int LLVM_ATTRIBUTE_UNUSED MPIModuleAnchorDestination =
115#endif
116
117// This anchor is used to force the linker to link the ObjCModule.
118extern volatile int ObjCModuleAnchorSource;
119static int LLVM_ATTRIBUTE_UNUSED ObjCModuleAnchorDestination =
121
122// This anchor is used to force the linker to link the OpenMPModule.
123extern volatile int OpenMPModuleAnchorSource;
124static int LLVM_ATTRIBUTE_UNUSED OpenMPModuleAnchorDestination =
126
127// This anchor is used to force the linker to link the PerformanceModule.
128extern volatile int PerformanceModuleAnchorSource;
129static int LLVM_ATTRIBUTE_UNUSED PerformanceModuleAnchorDestination =
131
132// This anchor is used to force the linker to link the PortabilityModule.
133extern volatile int PortabilityModuleAnchorSource;
134static int LLVM_ATTRIBUTE_UNUSED PortabilityModuleAnchorDestination =
136
137// This anchor is used to force the linker to link the ReadabilityModule.
138extern volatile int ReadabilityModuleAnchorSource;
139static int LLVM_ATTRIBUTE_UNUSED ReadabilityModuleAnchorDestination =
141
142// This anchor is used to force the linker to link the ZirconModule.
143extern volatile int ZirconModuleAnchorSource;
144static int LLVM_ATTRIBUTE_UNUSED ZirconModuleAnchorDestination =
146
147} // namespace clang::tidy
148
149#endif
volatile int CustomModuleAnchorSource
static int LLVM_ATTRIBUTE_UNUSED HICPPModuleAnchorDestination
volatile int MPIModuleAnchorSource
static int LLVM_ATTRIBUTE_UNUSED MiscModuleAnchorDestination
volatile int AlteraModuleAnchorSource
static int LLVM_ATTRIBUTE_UNUSED DarwinModuleAnchorDestination
volatile int DarwinModuleAnchorSource
volatile int LLVMLibcModuleAnchorSource
volatile int AndroidModuleAnchorSource
volatile int ConcurrencyModuleAnchorSource
volatile int HICPPModuleAnchorSource
static int LLVM_ATTRIBUTE_UNUSED ReadabilityModuleAnchorDestination
static int LLVM_ATTRIBUTE_UNUSED PortabilityModuleAnchorDestination
volatile int ZirconModuleAnchorSource
volatile int OpenMPModuleAnchorSource
static int LLVM_ATTRIBUTE_UNUSED GoogleModuleAnchorDestination
static int LLVM_ATTRIBUTE_UNUSED PerformanceModuleAnchorDestination
static int LLVM_ATTRIBUTE_UNUSED LLVMLibcModuleAnchorDestination
static int LLVM_ATTRIBUTE_UNUSED CppCoreGuidelinesModuleAnchorDestination
static int LLVM_ATTRIBUTE_UNUSED LLVMModuleAnchorDestination
volatile int AbseilModuleAnchorSource
static int LLVM_ATTRIBUTE_UNUSED ObjCModuleAnchorDestination
volatile int CERTModuleAnchorSource
volatile int PortabilityModuleAnchorSource
static int LLVM_ATTRIBUTE_UNUSED FuchsiaModuleAnchorDestination
volatile int ReadabilityModuleAnchorSource
volatile int ObjCModuleAnchorSource
volatile int CppCoreGuidelinesModuleAnchorSource
static int LLVM_ATTRIBUTE_UNUSED ZirconModuleAnchorDestination
static int LLVM_ATTRIBUTE_UNUSED ConcurrencyModuleAnchorDestination
volatile int LLVMModuleAnchorSource
volatile int LinuxKernelModuleAnchorSource
volatile int BoostModuleAnchorSource
static int LLVM_ATTRIBUTE_UNUSED AndroidModuleAnchorDestination
static int LLVM_ATTRIBUTE_UNUSED LinuxKernelModuleAnchorDestination
volatile int ModernizeModuleAnchorSource
volatile int FuchsiaModuleAnchorSource
static int LLVM_ATTRIBUTE_UNUSED CERTModuleAnchorDestination
static int LLVM_ATTRIBUTE_UNUSED BugproneModuleAnchorDestination
static int LLVM_ATTRIBUTE_UNUSED AbseilModuleAnchorDestination
volatile int BugproneModuleAnchorSource
static int LLVM_ATTRIBUTE_UNUSED ModernizeModuleAnchorDestination
static int LLVM_ATTRIBUTE_UNUSED BoostModuleAnchorDestination
static int LLVM_ATTRIBUTE_UNUSED OpenMPModuleAnchorDestination
volatile int GoogleModuleAnchorSource
volatile int MiscModuleAnchorSource
volatile int PerformanceModuleAnchorSource
static int LLVM_ATTRIBUTE_UNUSED AlteraModuleAnchorDestination