Skip to content

Commit

Permalink
[M68k][AsmParser] Support negative integer constants
Browse files Browse the repository at this point in the history
Parsing negative integer constants as expressions.

Differential Revision: https://reviews.llvm.org/D101732
  • Loading branch information
mshockwave committed May 6, 2021
1 parent 34da083 commit abac602
Show file tree
Hide file tree
Showing 15 changed files with 369 additions and 684 deletions.
6 changes: 4 additions & 2 deletions llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ class M68kAsmParser : public MCTargetAsmParser {
// Parser functions.
void eatComma();

bool isExpr() const;
bool isExpr();
OperandMatchResultTy parseImm(OperandVector &Operands);
OperandMatchResultTy parseMemOp(OperandVector &Operands);

Expand Down Expand Up @@ -581,11 +581,13 @@ OperandMatchResultTy M68kAsmParser::tryParseRegister(unsigned &RegNo,
return Result;
}

bool M68kAsmParser::isExpr() const {
bool M68kAsmParser::isExpr() {
switch (Parser.getTok().getKind()) {
case AsmToken::Identifier:
case AsmToken::Integer:
return true;
case AsmToken::Minus:
return getLexer().peekTok().getKind() == AsmToken::Integer;

default:
return false;
Expand Down
88 changes: 0 additions & 88 deletions llvm/test/CodeGen/M68k/Encoding/Arith/Classes/MxBiArOp_FMI.mir

This file was deleted.

73 changes: 0 additions & 73 deletions llvm/test/CodeGen/M68k/Encoding/Arith/Classes/MxBiArOp_FMR.mir

This file was deleted.

115 changes: 0 additions & 115 deletions llvm/test/CodeGen/M68k/Encoding/Bits/Classes/MxBTST_MI.mir

This file was deleted.

Loading

0 comments on commit abac602

Please sign in to comment.