forked from OSchip/llvm-project
[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
This commit is contained in:
parent
dbc16ed199
commit
7da22dfcd0
|
@ -460,6 +460,12 @@ private:
|
|||
// A digit in HLASM is a number from 0 to 9.
|
||||
inline bool isHLASMAlnum(char C) { return isHLASMAlpha(C) || isDigit(C); }
|
||||
|
||||
// Are we parsing using the AD_HLASM dialect?
|
||||
inline bool isParsingHLASM() { return getMAIAssemblerDialect() == AD_HLASM; }
|
||||
|
||||
// Are we parsing using the AD_ATT dialect?
|
||||
inline bool isParsingATT() { return getMAIAssemblerDialect() == AD_ATT; }
|
||||
|
||||
public:
|
||||
SystemZAsmParser(const MCSubtargetInfo &sti, MCAsmParser &parser,
|
||||
const MCInstrInfo &MII,
|
||||
|
@ -1606,7 +1612,7 @@ SystemZAsmParser::parsePCRel(OperandVector &Operands, int64_t MinVal,
|
|||
}
|
||||
|
||||
bool SystemZAsmParser::isLabel(AsmToken &Token) {
|
||||
if (getMAIAssemblerDialect() == AD_ATT)
|
||||
if (isParsingATT())
|
||||
return true;
|
||||
|
||||
// HLASM labels are ordinary symbols.
|
||||
|
|
Loading…
Reference in New Issue