RISCVAttributeParser.h 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. //===-- RISCVAttributeParser.h - RISCV Attribute Parser ---------*- C++ -*-===//
  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-exception
  6. //
  7. //===----------------------------------------------------------------------===//
  8. #ifndef LLVM_SUPPORT_RISCVATTRIBUTEPARSER_H
  9. #define LLVM_SUPPORT_RISCVATTRIBUTEPARSER_H
  10. #include "llvm/Support/ELFAttributeParser.h"
  11. #include "llvm/Support/RISCVAttributes.h"
  12. namespace llvm {
  13. class RISCVAttributeParser : public ELFAttributeParser {
  14. struct DisplayHandler {
  15. RISCVAttrs::AttrType attribute;
  16. Error (RISCVAttributeParser::*routine)(unsigned);
  17. };
  18. static const DisplayHandler displayRoutines[];
  19. Error handler(uint64_t tag, bool &handled) override;
  20. Error unalignedAccess(unsigned tag);
  21. Error stackAlign(unsigned tag);
  22. public:
  23. RISCVAttributeParser(ScopedPrinter *sw)
  24. : ELFAttributeParser(sw, RISCVAttrs::RISCVAttributeTags, "riscv") {}
  25. RISCVAttributeParser()
  26. : ELFAttributeParser(RISCVAttrs::RISCVAttributeTags, "riscv") {}
  27. };
  28. } // namespace llvm
  29. #endif