llvm-project/clang-tools-extra/clang-tidy/ClangTidyModuleRegistry.h
Thomas Fransham b735c66da9
Reland 'Update llvm::Registry to work for LLVM shared library builds on windows' (#109024) (#112640)
Fix missing extern templates for llvm::Registry use in other projects of
llvm

Windows doesn't implicitly import and merge exported symbols across
shared libraries
like Linux does so we need to explicitly export/import each
instantiation of llvm::Registry.
Updated LLVM_INSTANTIATE_REGISTRY to just be a full explicit template
instantiation.

This is part of the work to enable LLVM_BUILD_LLVM_DYLIB and LLVM
plugins on window.
2024-10-22 10:29:27 +03:00

26 lines
861 B
C++

//===--- ClangTidyModuleRegistry.h - clang-tidy -----------------*- C++ -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYMODULEREGISTRY_H
#define LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYMODULEREGISTRY_H
#include "ClangTidyModule.h"
#include "llvm/Support/Registry.h"
namespace clang::tidy {
using ClangTidyModuleRegistry = llvm::Registry<ClangTidyModule>;
} // namespace clang::tidy
namespace llvm {
extern template class Registry<clang::tidy::ClangTidyModule>;
} // namespace llvm
#endif // LLVM_CLANG_TOOLS_EXTRA_CLANG_TIDY_CLANGTIDYMODULEREGISTRY_H