
- 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
478 B
TableGen
13 lines
478 B
TableGen
// RUN: not llvm-tblgen -gen-subtarget -I %p/../../include %s 2>&1 | FileCheck %s -DFILE=%s
|
|
// Verify that processors with same names result in an error.
|
|
|
|
include "llvm/Target/Target.td"
|
|
|
|
def MyTarget : Target;
|
|
|
|
def ProcessorB : ProcessorModel<"NameA", NoSchedModel, []>;
|
|
|
|
// CHECK: [[FILE]]:[[@LINE+2]]:5: error: Processor `NameA` is already defined.
|
|
// CHECK: [[FILE]]:[[@LINE-3]]:5: note: Previous definition here.
|
|
def ProcessorA : ProcessorModel<"NameA", NoSchedModel, []>;
|