aboutsummaryrefslogtreecommitdiffstats
path: root/utils/TableGen/LLDBTableGenUtils.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'utils/TableGen/LLDBTableGenUtils.cpp')
-rw-r--r--utils/TableGen/LLDBTableGenUtils.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/utils/TableGen/LLDBTableGenUtils.cpp b/utils/TableGen/LLDBTableGenUtils.cpp
new file mode 100644
index 000000000000..8b4c7581c98b
--- /dev/null
+++ b/utils/TableGen/LLDBTableGenUtils.cpp
@@ -0,0 +1,21 @@
+//===- LLDBTableGenUtils.cpp ----------------------------------------------===//
+//
+// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
+// See https://llvm.org/LICENSE.txt for license information.
+// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
+//
+//===----------------------------------------------------------------------===//
+
+#include "LLDBTableGenUtils.h"
+#include "llvm/TableGen/Record.h"
+
+using namespace llvm;
+using namespace lldb_private;
+
+RecordsByName lldb_private::getRecordsByName(std::vector<Record *> Records,
+ StringRef Name) {
+ RecordsByName Result;
+ for (Record *R : Records)
+ Result[R->getValueAsString(Name).str()].push_back(R);
+ return Result;
+}