Skip to content

Commit

Permalink
[MC/AsmParser] Remove no-op overrides of parseDirective (NFC)
Browse files Browse the repository at this point in the history
Remove overrides of parseDirective that unconditionally return NoMatch.
This is what the base implementation does.

This is a follow-up to D154101 based on post-commit review feedback.
  • Loading branch information
s-barannikov committed Jul 4, 2023
1 parent fc0d1c0 commit fda24e8
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 27 deletions.
6 changes: 0 additions & 6 deletions llvm/lib/Target/BPF/AsmParser/BPFAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ class BPFAsmParser : public MCTargetAsmParser {
bool ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
SMLoc NameLoc, OperandVector &Operands) override;

ParseStatus parseDirective(AsmToken DirectiveID) override;

// "=" is used as assignment operator for assembly statment, so can't be used
// for symbol assignment.
bool equalIsAsmAssignment() override { return false; }
Expand Down Expand Up @@ -516,10 +514,6 @@ bool BPFAsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
return false;
}

ParseStatus BPFAsmParser::parseDirective(AsmToken DirectiveID) {
return ParseStatus::NoMatch;
}

extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeBPFAsmParser() {
RegisterMCAsmParser<BPFAsmParser> X(getTheBPFTarget());
RegisterMCAsmParser<BPFAsmParser> Y(getTheBPFleTarget());
Expand Down
6 changes: 0 additions & 6 deletions llvm/lib/Target/Lanai/AsmParser/LanaiAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ class LanaiAsmParser : public MCTargetAsmParser {

bool parsePrePost(StringRef Type, int *OffsetValue);

ParseStatus parseDirective(AsmToken DirectiveID) override;

bool ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
SMLoc NameLoc, OperandVector &Operands) override;

Expand Down Expand Up @@ -649,10 +647,6 @@ struct LanaiOperand : public MCParsedAsmOperand {

} // end anonymous namespace

ParseStatus LanaiAsmParser::parseDirective(AsmToken DirectiveID) {
return ParseStatus::NoMatch;
}

bool LanaiAsmParser::MatchAndEmitInstruction(SMLoc IdLoc, unsigned &Opcode,
OperandVector &Operands,
MCStreamer &Out,
Expand Down
4 changes: 0 additions & 4 deletions llvm/lib/Target/LoongArch/AsmParser/LoongArchAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,6 @@ class LoongArchAsmParser : public MCTargetAsmParser {
bool ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
SMLoc NameLoc, OperandVector &Operands) override;

ParseStatus parseDirective(AsmToken DirectiveID) override {
return ParseStatus::NoMatch;
}

bool MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
OperandVector &Operands, MCStreamer &Out,
uint64_t &ErrorInfo,
Expand Down
5 changes: 0 additions & 5 deletions llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,6 @@ class M68kAsmParser : public MCTargetAsmParser {
SMLoc &EndLoc) override;
bool ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
SMLoc NameLoc, OperandVector &Operands) override;
ParseStatus parseDirective(AsmToken DirectiveID) override;
bool MatchAndEmitInstruction(SMLoc IDLoc, unsigned &Opcode,
OperandVector &Operands, MCStreamer &Out,
uint64_t &ErrorInfo,
Expand Down Expand Up @@ -963,10 +962,6 @@ bool M68kAsmParser::ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
return false;
}

ParseStatus M68kAsmParser::parseDirective(AsmToken DirectiveID) {
return ParseStatus::NoMatch;
}

bool M68kAsmParser::invalidOperand(SMLoc const &Loc,
OperandVector const &Operands,
uint64_t const &ErrorInfo) {
Expand Down
6 changes: 0 additions & 6 deletions llvm/lib/Target/Xtensa/AsmParser/XtensaAsmParser.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,6 @@ class XtensaAsmParser : public MCTargetAsmParser {

SMLoc getLoc() const { return getParser().getTok().getLoc(); }

// Override MCTargetAsmParser.
ParseStatus parseDirective(AsmToken DirectiveID) override;
bool parseRegister(MCRegister &RegNo,
SMLoc &StartLoc, SMLoc &EndLoc) override;
bool ParseInstruction(ParseInstructionInfo &Info, StringRef Name,
Expand Down Expand Up @@ -697,10 +695,6 @@ bool XtensaAsmParser::ParseInstruction(ParseInstructionInfo &Info,
return false;
}

ParseStatus XtensaAsmParser::parseDirective(AsmToken DirectiveID) {
return ParseStatus::NoMatch;
}

// Force static initialization.
extern "C" LLVM_EXTERNAL_VISIBILITY void LLVMInitializeXtensaAsmParser() {
RegisterMCAsmParser<XtensaAsmParser> X(getTheXtensaTarget());
Expand Down

0 comments on commit fda24e8

Please sign in to comment.