LLVM 19.0.0git
RISCVISAUtils.h
Go to the documentation of this file.
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 <map>
18#include <string>
19
20namespace llvm {
21
22namespace RISCVISAUtils {
23constexpr StringLiteral AllStdExts = "mafdqlcbkjtpvnh";
24
25/// Represents the major and version number components of a RISC-V extension.
27 unsigned Major;
28 unsigned Minor;
29};
30
31bool compareExtension(const std::string &LHS, const std::string &RHS);
32
33/// Helper class for OrderedExtensionMap.
35 bool operator()(const std::string &LHS, const std::string &RHS) const {
36 return compareExtension(LHS, RHS);
37 }
38};
39
40/// OrderedExtensionMap is std::map, it's specialized to keep entries
41/// in canonical order of extension.
42typedef std::map<std::string, ExtensionVersion, ExtensionComparator>
44
45} // namespace RISCVISAUtils
46
47} // namespace llvm
48
49#endif
Value * RHS
Value * LHS
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
Definition: StringRef.h:845
constexpr StringLiteral AllStdExts
Definition: RISCVISAUtils.h:23
bool compareExtension(const std::string &LHS, const std::string &RHS)
std::map< std::string, ExtensionVersion, ExtensionComparator > OrderedExtensionMap
OrderedExtensionMap is std::map, it's specialized to keep entries in canonical order of extension.
Definition: RISCVISAUtils.h:43
This is an optimization pass for GlobalISel generic memory operations.
Definition: AddressRanges.h:18
Helper class for OrderedExtensionMap.
Definition: RISCVISAUtils.h:34
bool operator()(const std::string &LHS, const std::string &RHS) const
Definition: RISCVISAUtils.h:35
Represents the major and version number components of a RISC-V extension.
Definition: RISCVISAUtils.h:26