mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 18:36:05 +00:00

- Extract code for sorting and checking duplicate Records into a helper function and update `collectProcModels` to use the helper. - Update `FeatureKeyValues` to: (a) Remove code for duplicate checks and use the helper. (b) Trim features with empty name explicitly to be able to use the helper. - Make the sorting deterministic by using record name as a secondary key for sorting, and re-enable SubtargetFeatureUniqueNames.td test that was disabled due to the non-determinism of the error messages. - Change wording of error message when duplicate records are found to be source code position agnostic, since `First` may not be before `Second` lexically.
13 lines
472 B
TableGen
13 lines
472 B
TableGen
// RUN: not llvm-tblgen -gen-subtarget -I %p/../../include %s 2>&1 | FileCheck %s -DFILE=%s
|
|
// Verify that subtarget features with same names result in an error.
|
|
|
|
include "llvm/Target/Target.td"
|
|
|
|
def MyTarget : Target;
|
|
|
|
def FeatureB : SubtargetFeature<"NameA", "", "", "">;
|
|
|
|
// CHECK: [[FILE]]:[[@LINE+2]]:5: error: Feature `NameA` is already defined.
|
|
// CHECK: [[FILE]]:[[@LINE-3]]:5: note: Previous definition here.
|
|
def FeatureA : SubtargetFeature<"NameA", "", "", "">;
|