clang 20.0.0git
CompilationDatabasePluginRegistry.h
Go to the documentation of this file.
1//===- CompilationDatabasePluginRegistry.h ----------------------*- C++ -*-===//
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_TOOLING_COMPILATIONDATABASEPLUGINREGISTRY_H
10#define LLVM_CLANG_TOOLING_COMPILATIONDATABASEPLUGINREGISTRY_H
11
14#include "llvm/Support/Registry.h"
15
16namespace clang {
17namespace tooling {
18
19/// Interface for compilation database plugins.
20///
21/// A compilation database plugin allows the user to register custom compilation
22/// databases that are picked up as compilation database if the corresponding
23/// library is linked in. To register a plugin, declare a static variable like:
24///
25/// \code
26/// static CompilationDatabasePluginRegistry::Add<MyDatabasePlugin>
27/// X("my-compilation-database", "Reads my own compilation database");
28/// \endcode
30public:
32
33 /// Loads a compilation database from a build directory.
34 ///
35 /// \see CompilationDatabase::loadFromDirectory().
36 virtual std::unique_ptr<CompilationDatabase>
37 loadFromDirectory(StringRef Directory, std::string &ErrorMessage) = 0;
38};
39
41 llvm::Registry<CompilationDatabasePlugin>;
42
43} // namespace tooling
44} // namespace clang
45
46namespace llvm {
47extern template class CLANG_TEMPLATE_ABI
48 Registry<clang::tooling::CompilationDatabasePlugin>;
49} // namespace llvm
50
51#endif // LLVM_CLANG_TOOLING_COMPILATIONDATABASEPLUGINREGISTRY_H
Interface for compilation database plugins.
virtual std::unique_ptr< CompilationDatabase > loadFromDirectory(StringRef Directory, std::string &ErrorMessage)=0
Loads a compilation database from a build directory.
llvm::Registry< CompilationDatabasePlugin > CompilationDatabasePluginRegistry
The JSON file list parser is used to communicate input to InstallAPI.
Diagnostic wrappers for TextAPI types for error reporting.
Definition: Dominators.h:30