LLVM 24.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"
18#include <map>
19#include <string>
20
21namespace llvm {
22
23namespace RISCVISAUtils {
24constexpr StringLiteral AllStdExts = "mafdqlcbkjtvph";
25
26/// Represents the major and version number components of a RISC-V extension.
28 unsigned Major;
29 unsigned Minor;
30};
31
33
34/// Helper class for OrderedExtensionMap.
36 using is_transparent = void;
37
39 return compareExtension(LHS, RHS);
40 }
41};
42
43/// OrderedExtensionMap is std::map, it's specialized to keep entries
44/// in canonical order of extension.
46 std::map<std::string, ExtensionVersion, ExtensionComparator>;
47
48} // namespace RISCVISAUtils
49
50} // namespace llvm
51
52#endif
#define LLVM_ABI
Definition Compiler.h:211
Value * RHS
Value * LHS
A wrapper around a string literal that serves as a proxy for constructing global tables of StringRefs...
Definition StringRef.h:888
Represent a constant reference to a string, i.e.
Definition StringRef.h:56
constexpr StringLiteral AllStdExts
LLVM_ABI bool compareExtension(StringRef LHS, StringRef RHS)
std::map< std::string, ExtensionVersion, ExtensionComparator > OrderedExtensionMap
OrderedExtensionMap is std::map, it's specialized to keep entries in canonical order of extension.
This is an optimization pass for GlobalISel generic memory operations.
Helper class for OrderedExtensionMap.
bool operator()(StringRef LHS, StringRef RHS) const
Represents the major and version number components of a RISC-V extension.