This is an archive of the discontinued LLVM Phabricator instance.

[RISCV] Rework .option arch target streamer interface
ClosedPublic

Authored by jrtc27 on Jun 5 2023, 1:27 PM.

Details

Summary

The current interface requires some rather ugly tracking of state due to
splitting up the calls for each argument. Instead, pack them all into a
single call by passing an ArrayRef. Also clean up the dodgy whitespace
emitted for the directive whilst here; there was a stray space between
the tab and .option, and there was a tab rather than a space after the
first comma for some strange reason.

Diff Detail

Event Timeline

jrtc27 created this revision.Jun 5 2023, 1:27 PM
Herald added a project: Restricted Project. · View Herald TranscriptJun 5 2023, 1:27 PM
jrtc27 requested review of this revision.Jun 5 2023, 1:27 PM
jrtc27 added inline comments.
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
2743

NB: This is the reason for using std::string rather than StringRef in RISCVOptionArchArg

craig.topper added inline comments.Jun 5 2023, 4:03 PM
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
2743

Why do we need to emit a canonical ISA string instead of what was passed?

This revision is now accepted and ready to land.Jun 5 2023, 6:51 PM
jrtc27 added inline comments.Jun 5 2023, 7:23 PM
llvm/lib/Target/RISCV/AsmParser/RISCVAsmParser.cpp
2743

This is a good question, especially when we *don't* include a version number for .option arch, [+-]... dunno what makes more sense, but this was intended to be NFC (as was the dependency, modulo diagnostics)

This revision was automatically updated to reflect the committed changes.