2016-05-13 17:27:54 +08:00
|
|
|
//===-- YamlSymbolIndex.h ---------------------------------------*- C++ -*-===//
|
2016-04-29 17:23:38 +08:00
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
2016-05-13 17:27:54 +08:00
|
|
|
#ifndef LLVM_CLANG_TOOLS_EXTRA_INCLUDE_FIXER_YAMLSYMBOLINDEX_H
|
|
|
|
#define LLVM_CLANG_TOOLS_EXTRA_INCLUDE_FIXER_YAMLSYMBOLINDEX_H
|
2016-04-29 17:23:38 +08:00
|
|
|
|
2016-05-13 17:27:54 +08:00
|
|
|
#include "SymbolIndex.h"
|
2016-04-29 17:23:38 +08:00
|
|
|
#include "find-all-symbols/SymbolInfo.h"
|
2016-05-09 22:14:55 +08:00
|
|
|
#include "llvm/Support/ErrorOr.h"
|
2016-04-29 17:23:38 +08:00
|
|
|
#include <map>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace clang {
|
|
|
|
namespace include_fixer {
|
|
|
|
|
|
|
|
/// Yaml format database.
|
2016-05-13 17:27:54 +08:00
|
|
|
class YamlSymbolIndex : public SymbolIndex {
|
2016-04-29 17:23:38 +08:00
|
|
|
public:
|
2016-05-09 22:14:55 +08:00
|
|
|
/// Create a new Yaml db from a file.
|
2016-05-13 17:27:54 +08:00
|
|
|
static llvm::ErrorOr<std::unique_ptr<YamlSymbolIndex>>
|
2016-05-09 22:14:55 +08:00
|
|
|
createFromFile(llvm::StringRef FilePath);
|
|
|
|
/// Look for a file called \c Name in \c Directory and all parent directories.
|
2016-05-13 17:27:54 +08:00
|
|
|
static llvm::ErrorOr<std::unique_ptr<YamlSymbolIndex>>
|
2016-05-09 22:14:55 +08:00
|
|
|
createFromDirectory(llvm::StringRef Directory, llvm::StringRef Name);
|
2016-04-29 17:23:38 +08:00
|
|
|
|
2017-02-28 16:13:15 +08:00
|
|
|
std::vector<find_all_symbols::SymbolAndSignals>
|
2016-05-04 16:22:35 +08:00
|
|
|
search(llvm::StringRef Identifier) override;
|
2016-04-29 17:23:38 +08:00
|
|
|
|
|
|
|
private:
|
2016-05-13 17:27:54 +08:00
|
|
|
explicit YamlSymbolIndex(
|
2017-02-28 16:13:15 +08:00
|
|
|
std::vector<find_all_symbols::SymbolAndSignals> Symbols)
|
2016-05-09 22:14:55 +08:00
|
|
|
: Symbols(std::move(Symbols)) {}
|
|
|
|
|
2017-02-28 16:13:15 +08:00
|
|
|
std::vector<find_all_symbols::SymbolAndSignals> Symbols;
|
2016-04-29 17:23:38 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace include_fixer
|
|
|
|
} // namespace clang
|
|
|
|
|
2016-05-13 17:27:54 +08:00
|
|
|
#endif // LLVM_CLANG_TOOLS_EXTRA_INCLUDE_FIXER_YAMLSYMBOLINDEX_H
|