This is an archive of the discontinued LLVM Phabricator instance.

[TableGen] Improve error reporting
ClosedPublic

Authored by evandro on Nov 20 2017, 12:26 PM.

Details

Summary

When searching for a resource unit, use the reference location instead of the definition location in case of an error.

Diff Detail

Repository
rL LLVM

Event Timeline

evandro created this revision.Nov 20 2017, 12:26 PM
javed.absar edited edge metadata.EditedNov 21 2017, 2:20 AM

Thanks for this. Is it possible to put a test? If not, perhaps you can share the output generated for a purposely failing case here (by omitting a referenced resource).

Before this patch, a typical output would be like:

.../llvm/lib/Target/AArch64/AArch64SchedA57.td:49:3: error: No ProcessorResources associated with A57UnitV
  def A57UnitV : ProcResGroup<[A57UnitX, A57UnitW]>;    // Type V micro-ops
  ^

Whereas after this patch, the offending line is output instead:

.../llvm/lib/Target/AArch64/AArch64SchedM1.td:76:1: error: No ProcessorResources associated with A57UnitV
def M1WriteA1 : SchedWriteRes<[A57UnitV]> { let Latency = 1; }
^

The latter is obviously clear what the issue is, unlike the former.

javed.absar accepted this revision.Nov 21 2017, 11:18 AM

LGTM. Thanks for this.

This revision is now accepted and ready to land.Nov 21 2017, 11:18 AM
This revision was automatically updated to reflect the committed changes.