This is an archive of the discontinued LLVM Phabricator instance.

[SystemZ][z/OS] Introduce initial support for GOFF asm parser
ClosedPublic

Authored by anirudhp on Sep 29 2021, 9:41 AM.

Details

Summary
  • Introduce a skeleton outline for the GOFFAsmParser
  • Before instantiating AsmParser/HLASMAsmParser, target specific asm parsers are attempted to be initialized first before proceeding. If it doesn't exist for a particular file type, we report a fatal error.
  • This patch allows to properly instantiate the HLASMAsmParser on z/OS, and ensures we can write lit tests and unit tests which will involve the instantiation of asm parsers, without an assert / fatal error.

Diff Detail

Event Timeline

anirudhp created this revision.Sep 29 2021, 9:41 AM
anirudhp requested review of this revision.Sep 29 2021, 9:41 AM
Herald added a project: Restricted Project. · View Herald TranscriptSep 29 2021, 9:41 AM
Kai requested changes to this revision.Sep 29 2021, 10:39 AM
Kai added inline comments.
llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp
128

The name should be SystemZAsmLexerzOS - as the name of the OS is z/OS.

This revision now requires changes to proceed.Sep 29 2021, 10:39 AM
uweigand added inline comments.Sep 29 2021, 10:48 AM
llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp
128

On the other hand, as the first letter of a component in camel case, shouldn't the "z" still be capitalized? LexerzOS looks a bit weird to me :-)

Kai added inline comments.Sep 30 2021, 10:53 AM
llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp
128

Agree about the look.
IMHO we should make sure that we do not introduce too many variants of the name in the source. E.g. we already have isOSzOS() in the Triple class.
If we continue to use ZOS as the name in all identifiers, then I am ok with that.

uweigand added inline comments.Sep 30 2021, 11:00 AM
llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp
128

We also already have Triple::ZOS as well as the ZOS class in clang/lib/Driver/Toolchains/ZOS.cpp and the ZOSTargetInfo class in clang/lib/Basic/Target/OSTargets.h ...

anirudhp added inline comments.Sep 30 2021, 1:24 PM
llvm/unittests/MC/SystemZ/SystemZAsmLexerTest.cpp
128

Agree. We can use z/OS in comments wherever needed.

Kai accepted this revision.Sep 30 2021, 1:28 PM

LGTM.

This revision is now accepted and ready to land.Sep 30 2021, 1:28 PM
uweigand accepted this revision.Oct 1 2021, 12:58 AM

LGTM as well.

This revision was landed with ongoing or failed builds.Oct 1 2021, 7:29 AM
This revision was automatically updated to reflect the committed changes.