]> granicus.if.org Git - clang/commitdiff
[Tooling] Move CompilationDatabasePlugin to the Registry header, where it's useful...
authorSam McCall <sam.mccall@gmail.com>
Thu, 11 Oct 2018 13:42:53 +0000 (13:42 +0000)
committerSam McCall <sam.mccall@gmail.com>
Thu, 11 Oct 2018 13:42:53 +0000 (13:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@344247 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/Tooling/CompilationDatabase.h
include/clang/Tooling/CompilationDatabasePluginRegistry.h

index 37e515fdc09e4ce73a1adb0e1681a332e945440a..aa07cc30e5f5405c674055c1b7cbe91b2465ea99 100644 (file)
@@ -141,27 +141,6 @@ public:
   virtual std::vector<CompileCommand> getAllCompileCommands() const;
 };
 
-/// Interface for compilation database plugins.
-///
-/// A compilation database plugin allows the user to register custom compilation
-/// databases that are picked up as compilation database if the corresponding
-/// library is linked in. To register a plugin, declare a static variable like:
-///
-/// \code
-/// static CompilationDatabasePluginRegistry::Add<MyDatabasePlugin>
-/// X("my-compilation-database", "Reads my own compilation database");
-/// \endcode
-class CompilationDatabasePlugin {
-public:
-  virtual ~CompilationDatabasePlugin();
-
-  /// Loads a compilation database from a build directory.
-  ///
-  /// \see CompilationDatabase::loadFromDirectory().
-  virtual std::unique_ptr<CompilationDatabase>
-  loadFromDirectory(StringRef Directory, std::string &ErrorMessage) = 0;
-};
-
 /// A compilation database that returns a single compile command line.
 ///
 /// Useful when we want a tool to behave more like a compiler invocation.
index 051a08e2a91e8a0b7e0d39c9b0d3776167dbe18f..748ddbcf9d8d23e74359a93a5a6bff79976748a1 100644 (file)
 namespace clang {
 namespace tooling {
 
+/// Interface for compilation database plugins.
+///
+/// A compilation database plugin allows the user to register custom compilation
+/// databases that are picked up as compilation database if the corresponding
+/// library is linked in. To register a plugin, declare a static variable like:
+///
+/// \code
+/// static CompilationDatabasePluginRegistry::Add<MyDatabasePlugin>
+/// X("my-compilation-database", "Reads my own compilation database");
+/// \endcode
+class CompilationDatabasePlugin {
+public:
+  virtual ~CompilationDatabasePlugin();
+
+  /// Loads a compilation database from a build directory.
+  ///
+  /// \see CompilationDatabase::loadFromDirectory().
+  virtual std::unique_ptr<CompilationDatabase>
+  loadFromDirectory(StringRef Directory, std::string &ErrorMessage) = 0;
+};
+
 using CompilationDatabasePluginRegistry =
     llvm::Registry<CompilationDatabasePlugin>;