[llvm] [TableGen] Rework error reporting for duplicate Feature/Processor. (PR #102257)
Rahul Joshi via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 7 07:52:57 PDT 2024
================
@@ -0,0 +1,37 @@
+//===- Utils.cpp - Common Utilities -----------------------------*- C++ -*-===//
+//
+// 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 "Utils.h"
+#include "llvm/ADT/STLExtras.h"
+#include "llvm/TableGen/Error.h"
+#include "llvm/TableGen/Record.h"
+#include <algorithm>
+
+using namespace llvm;
+
+/// Sort an array of Records on the "Name" field, and check for records with
+/// duplicate "Name" field. If duplicates are found, report a fatal error.
+void llvm::sortAndReportDuplicates(std::vector<Record *> &Records,
----------------
jurahul wrote:
Done.
https://github.com/llvm/llvm-project/pull/102257
More information about the llvm-commits
mailing list