3 Commits

Author SHA1 Message Date
Rahul Joshi
8ce5a32f02
[TableGen] Rework error reporting for duplicate Feature/Processor (#102257)
- 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.
2024-08-08 02:00:36 +03:00
Rahul Joshi
30a4e9e5be
[NFC] Temporarily disable failing TableGen unit test. (#102308)
- This test was reported as failing in ASAN builds, with
non-deterministic order of the error message and note expected.
- This is due to llvm::sort() being unstable.
- Temporarily disable the test while its been fixed.
2024-08-07 15:41:05 +03:00
Rahul Joshi
4c97c52fe0
[TableGen] Emit better error message for duplicate Subtarget features. (#102090)
- Keep track of last definition of a feature in a `DenseMap` and use 
  it to report a better error message when a duplicate feature is found.
- Use StringMap instead of a std::map in `EmitStageAndOperandCycleData`
- Add a unit test to check if duplicate names are flagged.
2024-08-06 23:39:04 +02:00