[PATCH] D103343: [SystemZ][z/OS] Stricter condition for HLASM class instantiation

Anirudh Prasad via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri May 28 14:39:54 PDT 2021


anirudhp created this revision.
Herald added a subscriber: hiraditya.
anirudhp requested review of this revision.
Herald added a project: LLVM.
Herald added a subscriber: llvm-commits.

- A lot of lit tests simply specify the arch minus the triple. On z/OS, this could result in a scenario of some-other-triple-unknown-ibm-zos. This points to an incorrect triple + arch combo.
- To prevent this, isOSzOS change is switched in favour of isOSBinFormatGOFF.
- This is because, the GOFF format is set only if the triple is systemz and if the operating system is GOFF. And currently, there are no other architectures/os's using the GOFF file format.
- An argument could be made that the problematic tests be fixed to explicitly specify the arch-vendor-triple string, but there's a large number of these tests, and adding this stricter scope ensures that we aren't instantiating the incorrect instance of the AsmParser for other platforms when run on z/OS.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D103343

Files:
  llvm/lib/MC/MCParser/AsmParser.cpp


Index: llvm/lib/MC/MCParser/AsmParser.cpp
===================================================================
--- llvm/lib/MC/MCParser/AsmParser.cpp
+++ llvm/lib/MC/MCParser/AsmParser.cpp
@@ -6327,7 +6327,7 @@
 MCAsmParser *llvm::createMCAsmParser(SourceMgr &SM, MCContext &C,
                                      MCStreamer &Out, const MCAsmInfo &MAI,
                                      unsigned CB) {
-  if (C.getTargetTriple().isOSzOS())
+  if (C.getTargetTriple().isOSBinFormatGOFF())
     return new HLASMAsmParser(SM, C, Out, MAI, CB);
 
   return new AsmParser(SM, C, Out, MAI, CB);


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D103343.348588.patch
Type: text/x-patch
Size: 594 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20210528/dbfcb31d/attachment.bin>


More information about the llvm-commits mailing list