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
13#include "llvm/Support/Registry.h"
14
15namespace clang {
16namespace tooling {
17
18/// Interface for compilation database plugins.
19///
20/// A compilation database plugin allows the user to register custom compilation
21/// databases that are picked up as compilation database if the corresponding
22/// library is linked in. To register a plugin, declare a static variable like:
23///
24/// \code
25/// static CompilationDatabasePluginRegistry::Add<MyDatabasePlugin>
26/// X("my-compilation-database", "Reads my own compilation database");
27/// \endcode
29public:
31
32 /// Loads a compilation database from a build directory.
33 ///
34 /// \see CompilationDatabase::loadFromDirectory().
35 virtual std::unique_ptr<CompilationDatabase>
36 loadFromDirectory(StringRef Directory, std::string &ErrorMessage) = 0;
37};
38
40 llvm::Registry<CompilationDatabasePlugin>;
41
42} // namespace tooling
43} // namespace clang
44
45#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.