This is an archive of the discontinued LLVM Phabricator instance.

[MC] Allow targets to control whether '?' can be used in identifiers
Changes PlannedPublic

Authored by barannikov88 on Jun 30 2023, 5:36 PM.

Details

Reviewers
None
Summary

GNU assembler does not allow '?' in (unquoted) identifiers.
MC assembler allows it as an extension (D1978). '?' can be disabled at
the start of an identifier by setting AllowQuestionAtStartOfIdentifier
to false. This patch adds another knob, AllowQuestionInName, that
controls whether '?' can appear in the middle of an identifier.

With the knob turned off, something like "a?b" is now lexed as three
distinct tokens instead of one.

Unfortunately, there are no in-tree targets that need the new behavior,
so no tests.

Diff Detail

Event Timeline

barannikov88 created this revision.Jun 30 2023, 5:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 30 2023, 5:36 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
barannikov88 requested review of this revision.Jun 30 2023, 5:36 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 30 2023, 5:36 PM

Call the correct method

barannikov88 planned changes to this revision.Jun 30 2023, 6:29 PM