diff options
author | Daniel Jasper <djasper@google.com> | 2012-07-11 19:13:13 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2012-07-11 19:13:13 +0000 |
commit | 068040ede2b2e6449d84273cc16e62fcd5e7e541 (patch) | |
tree | cbedd00519fe4f46f9d9dda77852a23f09905877 /lib/Tooling/CompilationDatabase.cpp | |
parent | 0337efdba2b9477c2655cbb176d59c492a823aa4 (diff) |
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
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160061 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Tooling/CompilationDatabase.cpp')
-rw-r--r-- | lib/Tooling/CompilationDatabase.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/Tooling/CompilationDatabase.cpp b/lib/Tooling/CompilationDatabase.cpp index a06343ddab..d54a5e79eb 100644 --- a/lib/Tooling/CompilationDatabase.cpp +++ b/lib/Tooling/CompilationDatabase.cpp @@ -18,6 +18,10 @@ #include "llvm/Support/Path.h" #include "llvm/Support/system_error.h" +#ifdef USE_CUSTOM_COMPILATION_DATABASE +#include "CustomCompilationDatabase.h" +#endif + namespace clang { namespace tooling { @@ -124,6 +128,11 @@ CompilationDatabase::loadFromDirectory(StringRef BuildDirectory, static CompilationDatabase * findCompilationDatabaseFromDirectory(StringRef Directory) { +#ifdef USE_CUSTOM_COMPILATION_DATABASE + if (CompilationDatabase *DB = + ::findCompilationDatabaseForDirectory(Directory)) + return DB; +#endif while (!Directory.empty()) { std::string LoadErrorMessage; |