mini-llvm
0.1.0
Toggle main menu visibility
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
7
#include "
mini-llvm/utils/Compiler.h
"
8
#include "
mini-llvm/utils/ErrorCode.h
"
9
10
namespace
mini_llvm
{
11
12
class
MINI_LLVM_EXPORT
SystemError
{
13
public
:
14
#ifdef _WIN32
15
using
native_type
=
unsigned
long;
16
#else
17
using
native_type
= int;
18
#endif
19
20
explicit
SystemError
(
ErrorCode
code
)
21
: code_(
code
) {}
22
23
SystemError
(
ErrorCode
code
,
native_type
native
)
24
: code_(
code
), native_(
native
) {}
25
26
ErrorCode
code
()
const
{
27
return
code_;
28
}
29
30
std::optional<native_type>
native
()
const
{
31
return
native_;
32
}
33
34
static
SystemError
fromNative
(
native_type
native
);
35
36
private
:
37
ErrorCode
code_;
38
std::optional<native_type> native_;
39
};
40
41
}
// namespace mini_llvm
Compiler.h
MINI_LLVM_EXPORT
#define MINI_LLVM_EXPORT
Definition
Compiler.h:17
ErrorCode.h
mini_llvm::SystemError::SystemError
SystemError(ErrorCode code)
Definition
SystemError.h:20
mini_llvm::SystemError::fromNative
static SystemError fromNative(native_type native)
mini_llvm::SystemError::native
std::optional< native_type > native() const
Definition
SystemError.h:30
mini_llvm::SystemError::native_type
int native_type
Definition
SystemError.h:17
mini_llvm::SystemError::SystemError
SystemError(ErrorCode code, native_type native)
Definition
SystemError.h:23
mini_llvm::SystemError::code
ErrorCode code() const
Definition
SystemError.h:26
mini_llvm
Definition
GraphColoringAllocator.h:13
mini_llvm::ErrorCode
ErrorCode
Definition
ErrorCode.h:9
include
mini-llvm
utils
SystemError.h
Generated by
1.17.0