18ce5a32fSRahul Joshi //===- Utils.h - Common Utilities -------------------------------*- C++ -*-===// 28ce5a32fSRahul Joshi // 38ce5a32fSRahul Joshi // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 48ce5a32fSRahul Joshi // See https://llvm.org/LICENSE.txt for license information. 58ce5a32fSRahul Joshi // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 68ce5a32fSRahul Joshi // 78ce5a32fSRahul Joshi //===----------------------------------------------------------------------===// 88ce5a32fSRahul Joshi 98ce5a32fSRahul Joshi #ifndef LLVM_UTILS_TABLEGEN_COMMON_UTILS_H 108ce5a32fSRahul Joshi #define LLVM_UTILS_TABLEGEN_COMMON_UTILS_H 118ce5a32fSRahul Joshi 128ce5a32fSRahul Joshi #include "llvm/ADT/ArrayRef.h" 138ce5a32fSRahul Joshi #include "llvm/ADT/StringRef.h" 148ce5a32fSRahul Joshi 158ce5a32fSRahul Joshi namespace llvm { 168ce5a32fSRahul Joshi class Record; 178ce5a32fSRahul Joshi 188ce5a32fSRahul Joshi /// Sort an array of Records on the "Name" field, and check for records with 198ce5a32fSRahul Joshi /// duplicate "Name" field. If duplicates are found, report a fatal error. 20*3ae71d15SRahul Joshi void sortAndReportDuplicates(MutableArrayRef<const Record *> Records, 218ce5a32fSRahul Joshi StringRef ObjectName); 228ce5a32fSRahul Joshi 238ce5a32fSRahul Joshi } // namespace llvm 248ce5a32fSRahul Joshi 258ce5a32fSRahul Joshi #endif // LLVM_UTILS_TABLEGEN_COMMON_UTILS_H 26