Path: blob/main/contrib/llvm-project/lldb/source/Plugins/SymbolFile/DWARF/ManualDWARFIndexSet.h
213845 views
//===-- ManualDWARFIndexSet.h -----------------------------------*- C++ -*-===//1//2// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.3// See https://llvm.org/LICENSE.txt for license information.4// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception5//6//===----------------------------------------------------------------------===//78#ifndef LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_MANUALDWARFINDEXSET_H9#define LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_MANUALDWARFINDEXSET_H1011#include "Plugins/SymbolFile/DWARF/NameToDIE.h"12#include "lldb/Utility/DataEncoder.h"13#include "lldb/Utility/DataExtractor.h"14#include "llvm/ADT/STLExtras.h"15#include <optional>1617namespace lldb_private::plugin::dwarf {1819template <typename T> struct IndexSet {20T function_basenames;21T function_fullnames;22T function_methods;23T function_selectors;24T objc_class_selectors;25T globals;26T types;27T namespaces;2829static std::array<T(IndexSet::*), 8> Indices() {30return {&IndexSet::function_basenames,31&IndexSet::function_fullnames,32&IndexSet::function_methods,33&IndexSet::function_selectors,34&IndexSet::objc_class_selectors,35&IndexSet::globals,36&IndexSet::types,37&IndexSet::namespaces};38}3940friend bool operator==(const IndexSet &lhs, const IndexSet &rhs) {41return llvm::all_of(Indices(), [&lhs, &rhs](T(IndexSet::*index)) {42return lhs.*index == rhs.*index;43});44}45};4647std::optional<IndexSet<NameToDIE>> DecodeIndexSet(const DataExtractor &data,48lldb::offset_t *offset_ptr);49void EncodeIndexSet(const IndexSet<NameToDIE> &set, DataEncoder &encoder);5051} // namespace lldb_private::plugin::dwarf5253#endif // LLDB_SOURCE_PLUGINS_SYMBOLFILE_DWARF_MANUALDWARFINDEXSET_H545556