diff options
author | Manuel Klimek <klimek@google.com> | 2012-07-10 13:10:51 +0000 |
---|---|---|
committer | Manuel Klimek <klimek@google.com> | 2012-07-10 13:10:51 +0000 |
commit | 8fa2fb859a4cb8e67d9763225281d9b0aa9cb59f (patch) | |
tree | baba2e136725c1e8cba0ce410db39759981af927 /include/clang/Tooling/CompilationDatabase.h | |
parent | 3f6d513d51a382371669f4d0b943fa830fffeef2 (diff) |
Adds support for auto-detection of compilation databases
from a source file and changes clang-check to make use of this.
This makes clang-check just work on in-tree builds, and allows
easy setup via a symlink per source directory to make clang-check
work without any extra configuration.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159990 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include/clang/Tooling/CompilationDatabase.h')
-rw-r--r-- | include/clang/Tooling/CompilationDatabase.h | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/include/clang/Tooling/CompilationDatabase.h b/include/clang/Tooling/CompilationDatabase.h index 625c8eced4..0dec6f8f87 100644 --- a/include/clang/Tooling/CompilationDatabase.h +++ b/include/clang/Tooling/CompilationDatabase.h @@ -81,6 +81,13 @@ public: static CompilationDatabase *loadFromDirectory(StringRef BuildDirectory, std::string &ErrorMessage); + /// \brief Tries to detect a compilation database location and load it. + /// + /// Looks for a compilation database in all parent paths by calling + /// loadFromDirectory. + static CompilationDatabase *autoDetectFromSource(StringRef SourceFile, + std::string &ErrorMessage); + /// \brief Returns all compile commands in which the specified file was /// compiled. /// @@ -215,4 +222,3 @@ private: } // end namespace clang #endif // LLVM_CLANG_TOOLING_COMPILATION_DATABASE_H - |