Add hppa*-*-hpux* to targets which do not support split DWARF
[official-gcc.git] / gcc / config / riscv / riscv-subset.h
blob14461838db5ac305f3fe106e3671b4a8484a4e0f
1 /* Definition of data structure of RISC-V subset for GNU compiler.
2 Copyright (C) 2011-2024 Free Software Foundation, Inc.
3 Contributed by Andrew Waterman (andrew@sifive.com).
4 Based on MIPS target for GNU compiler.
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify
9 it under the terms of the GNU General Public License as published by
10 the Free Software Foundation; either version 3, or (at your option)
11 any later version.
13 GCC is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 GNU General Public License for more details.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING3. If not see
20 <http://www.gnu.org/licenses/>. */
22 #ifndef GCC_RISCV_SUBSET_H
23 #define GCC_RISCV_SUBSET_H
25 #define RISCV_DONT_CARE_VERSION -1
27 /* Subset info. */
28 struct riscv_subset_t
30 riscv_subset_t ();
32 std::string name;
33 int major_version;
34 int minor_version;
35 struct riscv_subset_t *next;
37 bool explicit_version_p;
38 bool implied_p;
41 /* Subset list. */
42 class riscv_subset_list
44 public:
45 /* Because the parse method is called in several places, to prevent repeated
46 errors, use this flag to prevent it from repeating parse. */
47 static bool parse_failed;
49 private:
50 /* Original arch string. */
51 const char *m_arch;
53 /* Location of arch string, used for report error. */
54 location_t m_loc;
56 /* Head of subset info list. */
57 riscv_subset_t *m_head;
59 /* Tail of subset info list. */
60 riscv_subset_t *m_tail;
62 /* X-len of m_arch. */
63 unsigned m_xlen;
65 riscv_subset_list (const char *, location_t);
67 const char *parsing_subset_version (const char *, const char *, unsigned *,
68 unsigned *, bool, bool *);
70 const char *parse_std_ext (const char *);
72 const char *parse_single_std_ext (const char *);
74 const char *parse_multiletter_ext (const char *, const char *,
75 const char *);
76 const char *parse_single_multiletter_ext (const char *, const char *,
77 const char *);
79 void handle_implied_ext (const char *);
80 bool check_implied_ext ();
81 void handle_combine_ext ();
82 void check_conflict_ext ();
84 public:
85 ~riscv_subset_list ();
87 void add (const char *, int, int, bool, bool);
89 void add (const char *, bool);
91 riscv_subset_t *lookup (const char *,
92 int major_version = RISCV_DONT_CARE_VERSION,
93 int minor_version = RISCV_DONT_CARE_VERSION) const;
95 std::string to_string (bool) const;
97 unsigned xlen () const {return m_xlen;};
99 riscv_subset_list *clone () const;
101 static riscv_subset_list *parse (const char *, location_t);
102 const char *parse_single_ext (const char *);
104 const riscv_subset_t *begin () const {return m_head;};
105 const riscv_subset_t *end () const {return NULL;};
107 int match_score (riscv_subset_list *) const;
109 void set_loc (location_t);
112 extern const riscv_subset_list *riscv_current_subset_list (void);
113 extern void
114 riscv_set_arch_by_subset_list (riscv_subset_list *, struct gcc_options *);
116 #endif /* ! GCC_RISCV_SUBSET_H */