| 1 | //===- LLDBTableGenUtils.h --------------------------------------*- 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 LLDB_UTILS_TABLEGEN_LLDBTABLEGENUTILS_H |
| 10 | #define LLDB_UTILS_TABLEGEN_LLDBTABLEGENUTILS_H |
| 11 | |
| 12 | #include "llvm/ADT/ArrayRef.h" |
| 13 | #include "llvm/ADT/StringRef.h" |
| 14 | #include <map> |
| 15 | #include <string> |
| 16 | #include <vector> |
| 17 | |
| 18 | namespace llvm { |
| 19 | class RecordKeeper; |
| 20 | class Record; |
| 21 | } // namespace llvm |
| 22 | |
| 23 | namespace lldb_private { |
| 24 | |
| 25 | /// Map of names to their associated records. This map also ensures that our |
| 26 | /// records are sorted in a deterministic way. |
| 27 | typedef std::map<std::string, std::vector<const llvm::Record *>> RecordsByName; |
| 28 | |
| 29 | /// Return records grouped by name. |
| 30 | RecordsByName getRecordsByName(llvm::ArrayRef<const llvm::Record *> Records, |
| 31 | llvm::StringRef); |
| 32 | |
| 33 | } // namespace lldb_private |
| 34 | |
| 35 | #endif |
| 36 | |