mini-llvm 0.1.0
Loading...
Searching...
No Matches
RISCVRegister.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2
3#pragma once
4
5#include <cstdlib>
6
7namespace mini_llvm::mc {
8
10#define REGS
11#define X(idx, name, class, width, isPreserved, isAllocatable) RISCV_##name = idx,
12#include "mini-llvm/targets/riscv/target.def"
13#undef X
14#undef REGS
15};
16
17inline constexpr const char *name(RISCVRegister reg) {
18 switch (reg) {
19#define REGS
20#define X(idx, name, class, width, isPreserved, isAllocatable) case RISCV_##name: return #name;
21#include "mini-llvm/targets/riscv/target.def"
22#undef X
23#undef REGS
24 default:
25 abort();
26 }
27}
28
29} // namespace mini_llvm::mc
Definition Directive.h:8
RISCVRegister
Definition RISCVRegister.h:9
constexpr const char * name(RISCVRegister reg)
Definition RISCVRegister.h:17