This is an archive of the discontinued LLVM Phabricator instance.

[AMDGPU][MC] Corrected error position for invalid dim modifiers
ClosedPublic

Authored by dp on Feb 5 2021, 4:06 AM.

Details

Summary

Error position for an invalid dim modifier may be reported incorrectly.
See bug 49054.

Diff Detail

Event Timeline

dp created this revision.Feb 5 2021, 4:06 AM
dp requested review of this revision.Feb 5 2021, 4:06 AM
Herald added a project: Restricted Project. · View Herald TranscriptFeb 5 2021, 4:06 AM
foad added a comment.Feb 5 2021, 7:31 AM

Looks OK, but it's a shame to have to repeat the same error message three times in the source.

llvm/lib/Target/AMDGPU/AsmParser/AMDGPUAsmParser.cpp
7189

All the other errors start with a lower case letter.

dp updated this revision to Diff 321798.Feb 5 2021, 9:19 AM

Fixed issues found by Jay:

  • Corrected error message;
  • Refactored to avoid duplication of code.
foad accepted this revision.Feb 5 2021, 9:28 AM

Looks good, thanks! Aa an alternative, parseDimId could return Optional<unsigned>.

This revision is now accepted and ready to land.Feb 5 2021, 9:28 AM
rampitec accepted this revision.Feb 5 2021, 9:31 AM

LGTM

This revision was automatically updated to reflect the committed changes.