[llvm] [TableGen] Rework error reporting for duplicate Feature/Processor. (PR #102257)
Sergei Barannikov via llvm-commits
llvm-commits at lists.llvm.org
Wed Aug 7 10:42:48 PDT 2024
s-barannikov wrote:
> Also note that this is not true. The records vended out by getAllDerivedDefinitions() are sorted by name and not their lexical order, so even in the previous case the "Previous" definition could have been a later one.
I agree with this.
```
def ProcessorA : ProcessorModel<"SameName", NoSchedModel, []>;
multiclass M {
def C : ProcessorModel<"SameName", NoSchedModel, []>;
}
def ProcessorB : ProcessorModel<"SameName", NoSchedModel, []>;
defm : M;
```
The old code complained about ProcessorA.
This is also an example where the "source location" is not clearly defined. I would argue that the error should complain about ProcessorB, not about C instantiated from M even though C precedes ProcessorB in source order.
https://github.com/llvm/llvm-project/pull/102257
More information about the llvm-commits
mailing list