[MC/AsmParser] Remove no-op overrides of parseDirective (NFC)
authorSergei Barannikov <barannikov88@gmail.com>
Tue, 4 Jul 2023 21:00:07 +0000 (00:00 +0300)
committerSergei Barannikov <barannikov88@gmail.com>
Tue, 4 Jul 2023 21:01:55 +0000 (00:01 +0300)
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.

llvm/lib/Target/BPF/AsmParser/BPFAsmParser.cpp
llvm/lib/Target/Lanai/AsmParser/LanaiAsmParser.cpp
llvm/lib/Target/LoongArch/AsmParser/LoongArchAsmParser.cpp
llvm/lib/Target/M68k/AsmParser/M68kAsmParser.cpp
llvm/lib/Target/Xtensa/AsmParser/XtensaAsmParser.cpp

index 9896ddd..43edcaa 100644 (file)
@@ -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; }
@@ -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());
index cf84e86..6b74423 100644 (file)
@@ -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;
 
@@ -649,10 +647,6 @@ public:
 
 } // end anonymous namespace
 
-ParseStatus LanaiAsmParser::parseDirective(AsmToken DirectiveID) {
-  return ParseStatus::NoMatch;
-}
-
 bool LanaiAsmParser::MatchAndEmitInstruction(SMLoc IdLoc, unsigned &Opcode,
                                              OperandVector &Operands,
                                              MCStreamer &Out,
index 36ae998..a31d4d4 100644 (file)
@@ -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,
index 4fca313..7a0a033 100644 (file)
@@ -72,7 +72,6 @@ public:
                                         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,
@@ -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) {
index 39998ff..8ffe125 100644 (file)
@@ -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,
@@ -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());