2016-05-13 17:27:54 +08:00
|
|
|
//===-- InMemorySymbolIndex.h -----------------------------------*- C++ -*-===//
|
2016-04-20 20:43:43 +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_INMEMORYSYMBOLINDEX_H
|
|
|
|
#define LLVM_CLANG_TOOLS_EXTRA_INCLUDE_FIXER_INMEMORYSYMBOLINDEX_H
|
2016-04-20 20:43:43 +08:00
|
|
|
|
2016-05-13 17:27:54 +08:00
|
|
|
#include "SymbolIndex.h"
|
2016-04-20 20:43:43 +08:00
|
|
|
#include <map>
|
|
|
|
#include <string>
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace clang {
|
|
|
|
namespace include_fixer {
|
|
|
|
|
|
|
|
/// Xref database with fixed content.
|
2016-05-13 17:27:54 +08:00
|
|
|
class InMemorySymbolIndex : public SymbolIndex {
|
2016-04-20 20:43:43 +08:00
|
|
|
public:
|
2016-05-13 23:17:17 +08:00
|
|
|
InMemorySymbolIndex(const std::vector<find_all_symbols::SymbolInfo> &Symbols);
|
2016-04-20 20:43:43 +08:00
|
|
|
|
2016-05-04 16:22:35 +08:00
|
|
|
std::vector<clang::find_all_symbols::SymbolInfo>
|
|
|
|
search(llvm::StringRef Identifier) override;
|
2016-04-20 20:43:43 +08:00
|
|
|
|
|
|
|
private:
|
2016-05-04 16:22:35 +08:00
|
|
|
std::map<std::string, std::vector<clang::find_all_symbols::SymbolInfo>>
|
|
|
|
LookupTable;
|
2016-04-20 20:43:43 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace include_fixer
|
|
|
|
} // namespace clang
|
|
|
|
|
2016-05-13 17:27:54 +08:00
|
|
|
#endif // LLVM_CLANG_TOOLS_EXTRA_INCLUDE_FIXER_INMEMORYSYMBOLINDEX_H
|