summaryrefslogtreecommitdiffstats
path: root/clang/lib/Tooling/CustomCompilationDatabase.h
diff options
context:
space:
mode:
authorDaniel Jasper <djasper@google.com>2012-07-11 19:13:13 +0000
committerDaniel Jasper <djasper@google.com>2012-07-11 19:13:13 +0000
commitbb89ae939241f166521d74bc4159eaf45377fff3 (patch)
tree847a76feb9f3a41de70aadf58b8be4974eaa0b75 /clang/lib/Tooling/CustomCompilationDatabase.h
parent4dce73af05b28ec30761c4b47f5de34b0b087e16 (diff)
downloadbcm5719-llvm-bb89ae939241f166521d74bc4159eaf45377fff3.tar.gz
bcm5719-llvm-bb89ae939241f166521d74bc4159eaf45377fff3.zip
Add a hook to supply a custom CompilationDatabase. To add a custom CompilationDatabase, make it implement findCompilationDatabaseForDirectory in CustomCompilationDatabase.h and set USE_COSTUM_COMPILATION_DATABASE.
Differential Revision: http://llvm-reviews.chandlerc.com/D4 llvm-svn: 160061
Diffstat (limited to 'clang/lib/Tooling/CustomCompilationDatabase.h')
-rw-r--r--clang/lib/Tooling/CustomCompilationDatabase.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/clang/lib/Tooling/CustomCompilationDatabase.h b/clang/lib/Tooling/CustomCompilationDatabase.h
new file mode 100644
index 00000000000..a24915a08f7
--- /dev/null
+++ b/clang/lib/Tooling/CustomCompilationDatabase.h
@@ -0,0 +1,37 @@
+//===--- CustomCompilationDatabase.h --------------------------------------===//
+//
+// The LLVM Compiler Infrastructure
+//
+// This file is distributed under the University of Illinois Open Source
+// License. See LICENSE.TXT for details.
+//
+//===----------------------------------------------------------------------===//
+//
+// This file contains a hook to supply a custom \c CompilationDatabase
+// implementation.
+//
+// The mechanism can be used by IDEs or non-public code bases to integrate with
+// their build system. Currently we support statically linking in an
+// implementation of \c findCompilationDatabaseForDirectory and enabling it
+// with -DUSE_CUSTOM_COMPILATION_DATABASE when compiling the Tooling library.
+//
+// FIXME: The strategy forward is to provide a plugin system that can load
+// custom compilation databases and make enabling that a build option.
+//
+//===----------------------------------------------------------------------===//
+
+#include "llvm/ADT/StringRef.h"
+
+namespace clang {
+namespace tooling {
+class CompilationDatabase;
+}
+}
+
+/// \brief Returns a CompilationDatabase for the given \c Directory.
+///
+/// \c Directory can be any directory within a project. This methods will
+/// then try to find compilation database files in \c Directory or any of its
+/// parents. If a compilation database cannot be found or loaded, returns NULL.
+clang::tooling::CompilationDatabase *findCompilationDatabaseForDirectory(
+ llvm::StringRef Directory);
OpenPOWER on IntegriCloud