[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / llvm / lib / MC / MCParser / GOFFAsmParser.cpp
blobc3fc04607273583f481e0121b53e352faf031ca6
1 //===- GOFFAsmParser.cpp - GOFF Assembly Parser ---------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #include "llvm/MC/MCParser/MCAsmParserExtension.h"
11 using namespace llvm;
13 namespace {
15 class GOFFAsmParser : public MCAsmParserExtension {
16 template <bool (GOFFAsmParser::*HandlerMethod)(StringRef, SMLoc)>
17 void addDirectiveHandler(StringRef Directive) {
18 MCAsmParser::ExtensionDirectiveHandler Handler =
19 std::make_pair(this, HandleDirective<GOFFAsmParser, HandlerMethod>);
21 getParser().addDirectiveHandler(Directive, Handler);
24 public:
25 GOFFAsmParser() = default;
27 void Initialize(MCAsmParser &Parser) override {
28 // Call the base implementation.
29 this->MCAsmParserExtension::Initialize(Parser);
33 } // namespace
35 namespace llvm {
37 MCAsmParserExtension *createGOFFAsmParser() { return new GOFFAsmParser; }
39 } // namespace llvm