36 lines · cpp
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-exception6//7//===----------------------------------------------------------------------===//8 9#include "llvm/MC/MCParser/MCAsmParserExtension.h"10 11using namespace llvm;12 13namespace {14 15class 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>);20 21 getParser().addDirectiveHandler(Directive, Handler);22 }23 24public:25 GOFFAsmParser() = default;26 27 void Initialize(MCAsmParser &Parser) override {28 // Call the base implementation.29 this->MCAsmParserExtension::Initialize(Parser);30 }31};32 33} // namespace34 35MCAsmParserExtension *llvm::createGOFFAsmParser() { return new GOFFAsmParser; }36