1 //===-- MSP430AttributeParser.h - MSP430 Attribute Parser -------*- C++ -*-===//
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 //===----------------------------------------------------------------------===//
10 /// This file contains support routines for parsing MSP430 ELF build attributes.
12 //===----------------------------------------------------------------------===//
14 #ifndef LLVM_SUPPORT_MSP430ATTRIBUTEPARSER_H
15 #define LLVM_SUPPORT_MSP430ATTRIBUTEPARSER_H
17 #include "llvm/Support/ELFAttributeParser.h"
18 #include "llvm/Support/MSP430Attributes.h"
21 class MSP430AttributeParser : public ELFAttributeParser {
22 struct DisplayHandler {
23 MSP430Attrs::AttrType Attribute;
24 Error (MSP430AttributeParser::*Routine)(MSP430Attrs::AttrType);
26 static const std::array<DisplayHandler, 4> DisplayRoutines;
28 Error parseISA(MSP430Attrs::AttrType Tag);
29 Error parseCodeModel(MSP430Attrs::AttrType Tag);
30 Error parseDataModel(MSP430Attrs::AttrType Tag);
31 Error parseEnumSize(MSP430Attrs::AttrType Tag);
33 Error handler(uint64_t Tag, bool &Handled) override;
36 MSP430AttributeParser(ScopedPrinter *SW)
37 : ELFAttributeParser(SW, MSP430Attrs::getMSP430AttributeTags(),
39 MSP430AttributeParser()
40 : ELFAttributeParser(MSP430Attrs::getMSP430AttributeTags(), "mspabi") {}