[PATCH] D57043: [clangd] Use the shared forced-linking code.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue Jan 22 01:59:20 PST 2019


hokein created this revision.
hokein added a reviewer: sammccall.
Herald added subscribers: kadircet, arphaman, jkorous, MaskRay, ioeric, ilya-biryukov, mgorny, srhines.

Also add a missing MPI module.


Repository:
  rCTE Clang Tools Extra

https://reviews.llvm.org/D57043

Files:
  clangd/CMakeLists.txt
  clangd/ClangdUnit.cpp


Index: clangd/ClangdUnit.cpp
===================================================================
--- clangd/ClangdUnit.cpp
+++ clangd/ClangdUnit.cpp
@@ -572,29 +572,6 @@
 }
 
 } // namespace clangd
-namespace tidy {
-// Force the linker to link in Clang-tidy modules.
-#define LINK_TIDY_MODULE(X)                                                    \
-  extern volatile int X##ModuleAnchorSource;                                   \
-  static int LLVM_ATTRIBUTE_UNUSED X##ModuleAnchorDestination =                \
-      X##ModuleAnchorSource
-LINK_TIDY_MODULE(CERT);
-LINK_TIDY_MODULE(Abseil);
-LINK_TIDY_MODULE(Boost);
-LINK_TIDY_MODULE(Bugprone);
-LINK_TIDY_MODULE(LLVM);
-LINK_TIDY_MODULE(CppCoreGuidelines);
-LINK_TIDY_MODULE(Fuchsia);
-LINK_TIDY_MODULE(Google);
-LINK_TIDY_MODULE(Android);
-LINK_TIDY_MODULE(Misc);
-LINK_TIDY_MODULE(Modernize);
-LINK_TIDY_MODULE(Performance);
-LINK_TIDY_MODULE(Portability);
-LINK_TIDY_MODULE(Readability);
-LINK_TIDY_MODULE(ObjC);
-LINK_TIDY_MODULE(HICPP);
-LINK_TIDY_MODULE(Zircon);
-#undef LINK_TIDY_MODULE
-} // namespace tidy
 } // namespace clang
+
+#include "../clang-tidy/ClangTidyForceLinker.h"
\ No newline at end of file
Index: clangd/CMakeLists.txt
===================================================================
--- clangd/CMakeLists.txt
+++ clangd/CMakeLists.txt
@@ -107,6 +107,12 @@
   ${CLANGD_ATOMIC_LIB}
   )
 
+if( CLANG_ENABLE_STATIC_ANALYZER )
+  target_link_libraries(clangDaemon PRIVATE
+    clangTidyMPIModule
+  )
+endif()
+
 if( LLVM_LIB_FUZZING_ENGINE OR LLVM_USE_SANITIZE_COVERAGE )
   add_subdirectory(fuzzer)
 endif()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D57043.182864.patch
Type: text/x-patch
Size: 1592 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20190122/16e0169c/attachment.bin>


More information about the cfe-commits mailing list