Skip to content

Commit 7da22df

Browse files
committed
[SystemZ][z/OS] Introduce dialect querying helper functions
- In the SystemZAsmParser, there will be a few queries to the type of dialect it is (AD_ATT, AD_HLASM) in future patches. - It would be nice to have two small helper functions `isParsingATT()` and `isParsingHLASM()` - Putting this as a separate smaller patch allows us to remove its definitions from other dependent patches. Reviewed By: uweigand, abhina.sreeskantharajan Differential Revision: https://reviews.llvm.org/D99891
1 parent dbc16ed commit 7da22df

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

llvm/lib/Target/SystemZ/AsmParser/SystemZAsmParser.cpp

+7-1
Original file line numberDiff line numberDiff line change
@@ -460,6 +460,12 @@ class SystemZAsmParser : public MCTargetAsmParser {
460460
// A digit in HLASM is a number from 0 to 9.
461461
inline bool isHLASMAlnum(char C) { return isHLASMAlpha(C) || isDigit(C); }
462462

463+
// Are we parsing using the AD_HLASM dialect?
464+
inline bool isParsingHLASM() { return getMAIAssemblerDialect() == AD_HLASM; }
465+
466+
// Are we parsing using the AD_ATT dialect?
467+
inline bool isParsingATT() { return getMAIAssemblerDialect() == AD_ATT; }
468+
463469
public:
464470
SystemZAsmParser(const MCSubtargetInfo &sti, MCAsmParser &parser,
465471
const MCInstrInfo &MII,
@@ -1606,7 +1612,7 @@ SystemZAsmParser::parsePCRel(OperandVector &Operands, int64_t MinVal,
16061612
}
16071613

16081614
bool SystemZAsmParser::isLabel(AsmToken &Token) {
1609-
if (getMAIAssemblerDialect() == AD_ATT)
1615+
if (isParsingATT())
16101616
return true;
16111617

16121618
// HLASM labels are ordinary symbols.

0 commit comments

Comments
 (0)