clang-tools
22.0.0git
llvm-project
clang-tools-extra
clang-include-fixer
InMemorySymbolIndex.cpp
Go to the documentation of this file.
1
//===-- InMemorySymbolIndex.cpp--------------------------------------------===//
2
//
3
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4
// See https://llvm.org/LICENSE.txt for license information.
5
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6
//
7
//===----------------------------------------------------------------------===//
8
9
#include "
InMemorySymbolIndex.h
"
10
11
using
clang::find_all_symbols::SymbolAndSignals
;
12
13
namespace
clang
{
14
namespace
include_fixer
{
15
16
InMemorySymbolIndex::InMemorySymbolIndex
(
17
const
std::vector<SymbolAndSignals> &Symbols) {
18
for
(
const
auto
&Symbol : Symbols)
19
LookupTable[std::string(Symbol.Symbol.getName())].push_back(Symbol);
20
}
21
22
std::vector<SymbolAndSignals>
23
InMemorySymbolIndex::search
(llvm::StringRef Identifier) {
24
auto
I = LookupTable.find(Identifier);
25
if
(I != LookupTable.end())
26
return
I->second;
27
return
{};
28
}
29
30
}
// namespace include_fixer
31
}
// namespace clang
InMemorySymbolIndex.h
clang::include_fixer::InMemorySymbolIndex::InMemorySymbolIndex
InMemorySymbolIndex(const std::vector< find_all_symbols::SymbolAndSignals > &Symbols)
Definition
InMemorySymbolIndex.cpp:16
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:23
clang::include_fixer
Definition
FuzzySymbolIndex.cpp:15
clang
===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
Definition
ApplyReplacements.h:27
clang::find_all_symbols::SymbolAndSignals
Definition
SymbolInfo.h:125
Generated on
for clang-tools by
1.14.0