clang-tools 8.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
12 using clang::find_all_symbols::SymbolAndSignals;
13
14 namespace clang {
15 namespace include_fixer {
16
17 InMemorySymbolIndex::InMemorySymbolIndex(
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
clang::include_fixer::InMemorySymbolIndex::search
std::vector< find_all_symbols::SymbolAndSignals > search(llvm::StringRef Identifier) override
Search for all SymbolInfos corresponding to an identifier.
Definition: InMemorySymbolIndex.cpp:24
clang::include_fixer::InMemorySymbolIndex::InMemorySymbolIndex
InMemorySymbolIndex(const std::vector< find_all_symbols::SymbolAndSignals > &Symbols)
Definition: InMemorySymbolIndex.cpp:17
clang::find_all_symbols::SymbolAndSignals
Definition: SymbolInfo.h:127
clang
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Definition: ChangeNamespace.cpp:18
InMemorySymbolIndex.h