ClangTidyForceLinker.h 5.8 KB

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