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