xref: /src/contrib/llvm-project/lldb/utils/TableGen/LLDBTableGenUtils.cpp (revision 5b27928474e6a4103d65b347544705c40c9618fd)
1ead24645SDimitry Andric //===- LLDBTableGenUtils.cpp ----------------------------------------------===//
2ead24645SDimitry Andric //
3ead24645SDimitry Andric // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4ead24645SDimitry Andric // See https://llvm.org/LICENSE.txt for license information.
5ead24645SDimitry Andric // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6ead24645SDimitry Andric //
7ead24645SDimitry Andric //===----------------------------------------------------------------------===//
8ead24645SDimitry Andric 
9ead24645SDimitry Andric #include "LLDBTableGenUtils.h"
10ead24645SDimitry Andric #include "llvm/TableGen/Record.h"
11ead24645SDimitry Andric 
12ead24645SDimitry Andric using namespace llvm;
13ead24645SDimitry Andric using namespace lldb_private;
14ead24645SDimitry Andric 
getRecordsByName(std::vector<Record * > Records,StringRef Name)15ead24645SDimitry Andric RecordsByName lldb_private::getRecordsByName(std::vector<Record *> Records,
16ead24645SDimitry Andric                                              StringRef Name) {
17ead24645SDimitry Andric   RecordsByName Result;
18ead24645SDimitry Andric   for (Record *R : Records)
19ead24645SDimitry Andric     Result[R->getValueAsString(Name).str()].push_back(R);
20ead24645SDimitry Andric   return Result;
21ead24645SDimitry Andric }
22