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 Error atomicAbi(unsigned tag); 28 29 public: RISCVAttributeParser(ScopedPrinter * sw)30 RISCVAttributeParser(ScopedPrinter *sw) 31 : ELFAttributeParser(sw, RISCVAttrs::getRISCVAttributeTags(), "riscv") {} RISCVAttributeParser()32 RISCVAttributeParser() 33 : ELFAttributeParser(RISCVAttrs::getRISCVAttributeTags(), "riscv") {} 34 }; 35 36 } // namespace llvm 37 38 #endif 39