[nfc][mlir][scf]: Define scf.for lower/upper bounds can be also negative or zero...
[llvm-project.git] / llvm / lib / MC / MCParser / XCOFFAsmParser.cpp
blobd20a65f6a4763655b470ac6b7c7c29b1f11384df
1 //===- XCOFFAsmParser.cpp - XCOFF Assembly Parser
2 //-----------------------------===//
3 //
4 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
5 // See https://llvm.org/LICENSE.txt for license information.
6 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //
8 //===----------------------------------------------------------------------===//
10 #include "llvm/BinaryFormat/XCOFF.h"
11 #include "llvm/MC/MCParser/MCAsmParser.h"
12 #include "llvm/MC/MCParser/MCAsmParserExtension.h"
14 using namespace llvm;
16 namespace {
18 class XCOFFAsmParser : public MCAsmParserExtension {
19 MCAsmParser *Parser = nullptr;
20 MCAsmLexer *Lexer = nullptr;
22 template <bool (XCOFFAsmParser::*HandlerMethod)(StringRef, SMLoc)>
23 void addDirectiveHandler(StringRef Directive) {
24 MCAsmParser::ExtensionDirectiveHandler Handler =
25 std::make_pair(this, HandleDirective<XCOFFAsmParser, HandlerMethod>);
27 getParser().addDirectiveHandler(Directive, Handler);
30 public:
31 XCOFFAsmParser() = default;
33 void Initialize(MCAsmParser &P) override {
34 Parser = &P;
35 Lexer = &Parser->getLexer();
36 // Call the base implementation.
37 MCAsmParserExtension::Initialize(*Parser);
39 addDirectiveHandler<&XCOFFAsmParser::ParseDirectiveCSect>(".csect");
41 bool ParseDirectiveCSect(StringRef, SMLoc);
44 } // end anonymous namespace
46 namespace llvm {
48 MCAsmParserExtension *createXCOFFAsmParser() { return new XCOFFAsmParser; }
50 } // end namespace llvm
52 // .csect QualName [, Number ]
53 bool XCOFFAsmParser::ParseDirectiveCSect(StringRef, SMLoc) {
54 report_fatal_error("XCOFFAsmParser directive not yet supported!");
55 return false;