diff options
author | dim <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2012-08-15 20:02:54 +0000 |
commit | 554bcb69c2d785a011a30e7db87a36a87fe7db10 (patch) | |
tree | 9abb1a658a297776086f4e0dfa6ca533de02104e /lib/Tooling/CustomCompilationDatabase.h | |
parent | bb67ca86b31f67faee50bd10c3b036d65751745a (diff) | |
download | FreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.zip FreeBSD-src-554bcb69c2d785a011a30e7db87a36a87fe7db10.tar.gz |
Vendor import of clang trunk r161861:
http://llvm.org/svn/llvm-project/cfe/trunk@161861
Diffstat (limited to 'lib/Tooling/CustomCompilationDatabase.h')
-rw-r--r-- | lib/Tooling/CustomCompilationDatabase.h | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/lib/Tooling/CustomCompilationDatabase.h b/lib/Tooling/CustomCompilationDatabase.h new file mode 100644 index 0000000..b375f8d --- /dev/null +++ b/lib/Tooling/CustomCompilationDatabase.h @@ -0,0 +1,42 @@ +//===--- 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. +// +//===----------------------------------------------------------------------===// +#ifndef LLVM_CLANG_TOOLING_CUSTOM_COMPILATION_DATABASE_H +#define LLVM_CLANG_TOOLING_CUSTOM_COMPILATION_DATABASE_H + +#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); + +} // namespace tooling +} // namespace clang + +#endif // LLVM_CLANG_TOOLING_CUSTOM_COMPILATION_DATABASE_H |