mini-llvm 0.1.0
Loading...
Searching...
No Matches
ErrorCode.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2
3#pragma once
4
5#include <cerrno>
6
7namespace mini_llvm {
8
9enum class ErrorCode {
10#define X(name, value, message) k##name = value,
11#include "mini-llvm/utils/ErrorCode.def"
12#undef X
13};
14
15inline const char *message(ErrorCode code) {
16 using enum ErrorCode;
17
18#define X(name, value, message) if (code == k##name) return message;
19#include "mini-llvm/utils/ErrorCode.def"
20#undef X
21
22 return "Unknown error";
23}
24
25} // namespace mini_llvm
Definition GraphColoringAllocator.h:13
const char * message(ErrorCode code)
Definition ErrorCode.h:15
ErrorCode
Definition ErrorCode.h:9