summaryrefslogtreecommitdiffstats
path: root/contrib/llvm/tools/clang/lib/Tooling/CustomCompilationDatabase.h
blob: b375f8d25634a388201a679401055a5dc8d5e61b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
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
OpenPOWER on IntegriCloud