MSP430AttributeParser.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===-- MSP430AttributeParser.h - MSP430 Attribute Parser -------*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. ///
  14. /// \file
  15. /// This file contains support routines for parsing MSP430 ELF build attributes.
  16. ///
  17. //===----------------------------------------------------------------------===//
  18. #ifndef LLVM_SUPPORT_MSP430ATTRIBUTEPARSER_H
  19. #define LLVM_SUPPORT_MSP430ATTRIBUTEPARSER_H
  20. #include "llvm/Support/ELFAttributeParser.h"
  21. #include "llvm/Support/MSP430Attributes.h"
  22. namespace llvm {
  23. class MSP430AttributeParser : public ELFAttributeParser {
  24. struct DisplayHandler {
  25. MSP430Attrs::AttrType Attribute;
  26. Error (MSP430AttributeParser::*Routine)(MSP430Attrs::AttrType);
  27. };
  28. static const std::array<DisplayHandler, 4> DisplayRoutines;
  29. Error parseISA(MSP430Attrs::AttrType Tag);
  30. Error parseCodeModel(MSP430Attrs::AttrType Tag);
  31. Error parseDataModel(MSP430Attrs::AttrType Tag);
  32. Error parseEnumSize(MSP430Attrs::AttrType Tag);
  33. Error handler(uint64_t Tag, bool &Handled) override;
  34. public:
  35. MSP430AttributeParser(ScopedPrinter *SW)
  36. : ELFAttributeParser(SW, MSP430Attrs::getMSP430AttributeTags(),
  37. "mspabi") {}
  38. MSP430AttributeParser()
  39. : ELFAttributeParser(MSP430Attrs::getMSP430AttributeTags(), "mspabi") {}
  40. };
  41. } // namespace llvm
  42. #endif
  43. #ifdef __GNUC__
  44. #pragma GCC diagnostic pop
  45. #endif