clang-tools  7.0.0
InMemorySymbolIndex.cpp
Go to the documentation of this file.
1 //===-- InMemorySymbolIndex.cpp--------------------------------------------===//
2 //
3 // The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #include "InMemorySymbolIndex.h"
11 
13 
14 namespace clang {
15 namespace include_fixer {
16 
18  const std::vector<SymbolAndSignals> &Symbols) {
19  for (const auto &Symbol : Symbols)
20  LookupTable[Symbol.Symbol.getName()].push_back(Symbol);
21 }
22 
23 std::vector<SymbolAndSignals>
24 InMemorySymbolIndex::search(llvm::StringRef Identifier) {
25  auto I = LookupTable.find(Identifier);
26  if (I != LookupTable.end())
27  return I->second;
28  return {};
29 }
30 
31 } // namespace include_fixer
32 } // namespace clang
std::vector< find_all_symbols::SymbolAndSignals > search(llvm::StringRef Identifier) override
Search for all SymbolInfos corresponding to an identifier.
InMemorySymbolIndex(const std::vector< find_all_symbols::SymbolAndSignals > &Symbols)
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//