1 //===- GOFFAsmParser.cpp - GOFF Assembly Parser ---------------------------===//
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
7 //===----------------------------------------------------------------------===//
9 #include "llvm/MC/MCParser/MCAsmParserExtension.h"
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
);
25 GOFFAsmParser() = default;
27 void Initialize(MCAsmParser
&Parser
) override
{
28 // Call the base implementation.
29 this->MCAsmParserExtension::Initialize(Parser
);
37 MCAsmParserExtension
*createGOFFAsmParser() { return new GOFFAsmParser
; }