1 //===---- CSKYAttributeParser.h - CSKY 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_CSKYATTRIBUTEPARSER_H 10 #define LLVM_SUPPORT_CSKYATTRIBUTEPARSER_H 11 12 #include "llvm/Support/CSKYAttributes.h" 13 #include "llvm/Support/Compiler.h" 14 #include "llvm/Support/ELFAttrParserCompact.h" 15 16 namespace llvm { 17 class LLVM_ABI CSKYAttributeParser : public ELFCompactAttrParser { 18 struct DisplayHandler { 19 CSKYAttrs::AttrType attribute; 20 Error (CSKYAttributeParser::*routine)(unsigned); 21 }; 22 static const DisplayHandler displayRoutines[]; 23 24 Error dspVersion(unsigned tag); 25 Error vdspVersion(unsigned tag); 26 Error fpuVersion(unsigned tag); 27 Error fpuABI(unsigned tag); 28 Error fpuRounding(unsigned tag); 29 Error fpuDenormal(unsigned tag); 30 Error fpuException(unsigned tag); 31 Error fpuHardFP(unsigned tag); 32 33 Error handler(uint64_t tag, bool &handled) override; 34 35 public: 36 CSKYAttributeParser(ScopedPrinter *sw) 37 : ELFCompactAttrParser(sw, CSKYAttrs::getCSKYAttributeTags(), "csky") {} 38 CSKYAttributeParser() 39 : ELFCompactAttrParser(CSKYAttrs::getCSKYAttributeTags(), "csky") {} 40 }; 41 42 } // namespace llvm 43 44 #endif 45