1//===-- SymbolIndex.h - Interface for symbol-header matching ----*- C++ -*-===//
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#ifndef LLVM_CLANG_TOOLS_EXTRA_INCLUDE_FIXER_SYMBOLINDEX_H
10#define LLVM_CLANG_TOOLS_EXTRA_INCLUDE_FIXER_SYMBOLINDEX_H
11
12#include "find-all-symbols/SymbolInfo.h"
13#include "llvm/ADT/StringRef.h"
14#include <vector>
15
16namespace clang {
17namespace include_fixer {
18
19/// This class provides an interface for finding all `SymbolInfo`s corresponding
20/// to a symbol name from a symbol database.
21class SymbolIndex {
22public:
23 virtual ~SymbolIndex() = default;
24
25 /// Search for all `SymbolInfo`s corresponding to an identifier.
26 /// \param Identifier The unqualified identifier being searched for.
27 /// \returns A list of `SymbolInfo` candidates.
28 // FIXME: Expose the type name so we can also insert using declarations (or
29 // fix the usage)
30 virtual std::vector<find_all_symbols::SymbolAndSignals>
31 search(llvm::StringRef Identifier) = 0;
32};
33
34} // namespace include_fixer
35} // namespace clang
36
37#endif // LLVM_CLANG_TOOLS_EXTRA_INCLUDE_FIXER_SYMBOLINDEX_H
38

source code of clang-tools-extra/clang-include-fixer/SymbolIndex.h