MimIR
0.6-dev
MimIR is my Intermediate Representation
Toggle main menu visibility
Loading...
Searching...
No Matches
libcall.h
Go to the documentation of this file.
1
#pragma once
2
3
#include <
mim/phase/ds2cps.h
>
4
5
namespace
mim::plug::mach
{
6
7
/// Turns each operation without a native instruction into a call of its C library function, e.g. `expf`, `strlen`, or
8
/// `malloc`. It runs before `mem.add_mem`, which threads the memory through the calls of the memory-free ones.
9
class
LibCall
:
public
DS2CPS
{
10
public
:
11
using
DS2CPS::DS2CPS;
12
13
private
:
14
const
Def
*
rewrite_imm_App
(
const
App
*)
final
;
15
/// Lifts @p app into a call of the C function @p name that takes @p args and the continuation of @p app's type.
16
const
Def
* call(Sym
name
,
const
App
* app,
Defs
args
);
17
18
fe::SymMap<DefMap<Lam*>> decls_;
19
};
20
21
}
// namespace mim::plug::mach
mim::App
Definition
lam.h:215
mim::DS2CPS
An RWPhase that lifts direct-style calls of CPS functions out of the bodies of continuations.
Definition
ds2cps.h:25
mim::Def
Base class for all Defs.
Definition
def.h:285
mim::Phase::args
const fe::Vector< std::string > & args()
Command-line arguments passed to this Phase's plugin via -X <plugin>:<arg>.
Definition
phase.cpp:23
mim::Phase::name
std::string_view name() const
Definition
phase.h:63
mim::plug::mach::LibCall
Turns each operation without a native instruction into a call of its C library function,...
Definition
libcall.h:9
mim::plug::mach::LibCall::rewrite_imm_App
const Def * rewrite_imm_App(const App *) final
Definition
libcall.cpp:65
ds2cps.h
mim::plug::mach
The mach Plugin
Definition
asm.h:15
mim::Defs
fe::View< const Def * > Defs
Definition
def.h:94
include
mim
plug
mach
libcall.h
Generated by
1.18.0