mini-llvm 0.1.0
Loading...
Searching...
No Matches
SystemError.h
Go to the documentation of this file.
1// SPDX-License-Identifier: MIT
2
3#pragma once
4
5#include <optional>
6
9
10namespace mini_llvm {
11
13public:
14#ifdef _WIN32
15 using native_type = unsigned long;
16#else
17 using native_type = int;
18#endif
19
21 : code_(code) {}
22
25
26 ErrorCode code() const {
27 return code_;
28 }
29
30 std::optional<native_type> native() const {
31 return native_;
32 }
33
35
36private:
37 ErrorCode code_;
38 std::optional<native_type> native_;
39};
40
41} // namespace mini_llvm
#define MINI_LLVM_EXPORT
Definition Compiler.h:17
SystemError(ErrorCode code)
Definition SystemError.h:20
static SystemError fromNative(native_type native)
std::optional< native_type > native() const
Definition SystemError.h:30
int native_type
Definition SystemError.h:17
SystemError(ErrorCode code, native_type native)
Definition SystemError.h:23
ErrorCode code() const
Definition SystemError.h:26
Definition GraphColoringAllocator.h:13
ErrorCode
Definition ErrorCode.h:9