clang  8.0.0svn
CompilationDatabasePluginRegistry.h
Go to the documentation of this file.
1 //===- CompilationDatabasePluginRegistry.h ----------------------*- C++ -*-===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #ifndef LLVM_CLANG_TOOLING_COMPILATIONDATABASEPLUGINREGISTRY_H
11 #define LLVM_CLANG_TOOLING_COMPILATIONDATABASEPLUGINREGISTRY_H
12 
14 #include "llvm/Support/Registry.h"
15 
16 namespace clang {
17 namespace 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
30 public:
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 
46 #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
Dataflow Directional Tag Classes.