1//===-- RISCVISAUtils.h - RISC-V ISA Utilities ------------------*- 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// Utilities shared by TableGen and RISCVISAInfo.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef LLVM_SUPPORT_RISCVISAUTILS_H
14#define LLVM_SUPPORT_RISCVISAUTILS_H
15
16#include "llvm/ADT/StringRef.h"
17#include <string>
18
19namespace llvm {
20
21namespace RISCVISAUtils {
22constexpr StringLiteral AllStdExts = "mafdqlcbkjtpvnh";
23
24/// Represents the major and version number components of a RISC-V extension.
25struct ExtensionVersion {
26 unsigned Major;
27 unsigned Minor;
28};
29
30bool compareExtension(const std::string &LHS, const std::string &RHS);
31
32/// Helper class for OrderedExtensionMap.
33struct ExtensionComparator {
34 bool operator()(const std::string &LHS, const std::string &RHS) const {
35 return compareExtension(LHS, RHS);
36 }
37};
38} // namespace RISCVISAUtils
39
40} // namespace llvm
41
42#endif
43

source code of llvm/include/llvm/Support/RISCVISAUtils.h