MimIR
0.6-dev
MimIR is my Intermediate Representation
Toggle main menu visibility
Loading...
Searching...
No Matches
target.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <string_view>
4
5
#include "
mim/util/types.h
"
6
7
namespace
mim
{
8
9
/// The machine a native backend compiles for, as far as libmim needs to know it.
10
/// A backend plugin registers its Target via Plugin::target; see Driver::target and mim::plug::mach::Target.
11
class
Target
{
12
public
:
13
Target
(std::string_view
name
)
14
: name_(
name
) {}
15
virtual
~Target
() =
default
;
16
17
/// The plugin name, used as the prefix of diagnostics.
18
std::string_view
name
()
const
{
return
name_; }
19
/// The size and alignment of a pointer in bytes; see `core.trait`.
20
virtual
nat_t
ptr_size
()
const
= 0;
21
22
private
:
23
std::string_view name_;
24
};
25
26
}
// namespace mim
mim::Target::name
std::string_view name() const
The plugin name, used as the prefix of diagnostics.
Definition
target.h:18
mim::Target::Target
Target(std::string_view name)
Definition
target.h:13
mim::Target::ptr_size
virtual nat_t ptr_size() const =0
The size and alignment of a pointer in bytes; see core.trait.
mim::Target::~Target
virtual ~Target()=default
mim
Definition
ast.h:16
mim::nat_t
u64 nat_t
Definition
types.h:37
types.h
include
mim
target.h
Generated by
1.18.0