Home | History | Annotate | Line # | Download | only in Support
      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 
      9 #ifndef LLVM_SUPPORT_RISCVATTRIBUTEPARSER_H
     10 #define LLVM_SUPPORT_RISCVATTRIBUTEPARSER_H
     11 
     12 #include "llvm/Support/ELFAttributeParser.h"
     13 #include "llvm/Support/RISCVAttributes.h"
     14 
     15 namespace llvm {
     16 class RISCVAttributeParser : public ELFAttributeParser {
     17   struct DisplayHandler {
     18     RISCVAttrs::AttrType attribute;
     19     Error (RISCVAttributeParser::*routine)(unsigned);
     20   };
     21   static const DisplayHandler displayRoutines[];
     22 
     23   Error handler(uint64_t tag, bool &handled) override;
     24 
     25   Error unalignedAccess(unsigned tag);
     26   Error stackAlign(unsigned tag);
     27 
     28 public:
     29   RISCVAttributeParser(ScopedPrinter *sw)
     30       : ELFAttributeParser(sw, RISCVAttrs::RISCVAttributeTags, "riscv") {}
     31   RISCVAttributeParser()
     32       : ELFAttributeParser(RISCVAttrs::RISCVAttributeTags, "riscv") {}
     33 };
     34 
     35 } // namespace llvm
     36 
     37 #endif
     38