[JITLink][arm64] Support arm64e JIT'd code (initially enabled for MachO only).
[llvm-project.git] / clang-tools-extra / clang-include-fixer / InMemorySymbolIndex.cpp
blob6d272af7436923829d3f88e27dec8698acf35f98
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 //===----------------------------------------------------------------------===//
9 #include "InMemorySymbolIndex.h"
11 using clang::find_all_symbols::SymbolAndSignals;
13 namespace clang {
14 namespace include_fixer {
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);
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 {};
30 } // namespace include_fixer
31 } // namespace clang