This is an archive of the discontinued LLVM Phabricator instance.

MC: fix AsmLexer not understanding some escapes (notably '\r' and '\f')
Needs ReviewPublic

Authored by Ferdi265 on Jan 17 2021, 11:59 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This patch fixes Bug 48781.

llvm-mc, or also the integrated assembler in clang (which uses the same parser), doesn't understand the escapes '\r' and '\f'. This patch fixes that.

Reproducer: llvm-mc <(echo ".byte '\\r'")
Expected: .text .byte 13
Actual: .text .byte 114

After Bug 8615, support was added for basic character escapes, but '\r' and '\f' were seemingly forgotten.
By adding those two escapes to llvm-mc, LLVM would achieve feature parity with GNU as for character constants as described by the info as manual.

Diff Detail

Event Timeline

Ferdi265 created this revision.Jan 17 2021, 11:59 AM
Ferdi265 requested review of this revision.Jan 17 2021, 11:59 AM
Herald added a project: Restricted Project. · View Herald TranscriptJan 17 2021, 11:59 AM

Hi @Ferdi265, it looks like this has since been fixed by D99609.