llir-opt
0.0.1
Low-Level Post-Link Optimiser for OCaml and C
emitter
x86
x86runtime_printer.h
1
// This file if part of the llir-opt project.
2
// Licensing information can be found in the LICENSE file.
3
// (C) 2018 Nandor Licker. All rights reserved.
4
5
#pragma once
6
7
#include <llvm/Pass.h>
8
#include <llvm/MC/MCObjectFileInfo.h>
9
#include <llvm/MC/MCStreamer.h>
10
#include <llvm/Target/X86/X86Subtarget.h>
11
12
#include "emitter/runtime_printer.h"
13
14
class
Prog
;
15
class
Data
;
16
17
18
22
class
X86RuntimePrinter
final :
public
RuntimePrinter
{
23
public
:
24
static
char
ID
;
25
27
X86RuntimePrinter
(
28
const
Prog
&
Prog
,
29
const
llvm::TargetMachine &tm,
30
llvm::MCContext &ctx,
31
llvm::MCStreamer &os,
32
const
llvm::MCObjectFileInfo &objInfo,
33
bool
shared
34
);
35
36
private
:
38
llvm::StringRef getPassName()
const override
;
39
40
private
:
42
void
EmitCamlCallGc(llvm::Function &F)
override
;
44
void
EmitCamlCCall(llvm::Function &F)
override
;
45
46
private
:
48
llvm::MCSymbol *LowerSymbol(
const
std::string &name);
50
llvm::MCOperand LowerOperand(
const
std::string &name,
unsigned
Offset = 0);
52
llvm::MCOperand LowerOperand(llvm::MCSymbol *symbol,
unsigned
Offset = 0);
54
void
LowerCamlState(
unsigned
reg,
const
llvm::X86Subtarget &sti);
56
void
LowerStore(
57
unsigned
Reg,
58
unsigned
state,
59
const
std::string &name,
60
const
llvm::X86Subtarget &sti
61
);
63
void
LowerLoad(
64
unsigned
Reg,
65
unsigned
state,
66
const
std::string &name,
67
const
llvm::X86Subtarget &sti
68
);
70
void
AddAddr(llvm::MCInst &MI,
unsigned
state,
const
std::string &name);
71
};
Data
Definition:
data.h:47
ID
Definition:
id.h:19
X86RuntimePrinter::X86RuntimePrinter
X86RuntimePrinter(const Prog &Prog, const llvm::TargetMachine &tm, llvm::MCContext &ctx, llvm::MCStreamer &os, const llvm::MCObjectFileInfo &objInfo, bool shared)
Initialises the pass which prints data sections.
Definition:
x86runtime_printer.cpp:29
X86RuntimePrinter
Definition:
x86runtime_printer.h:22
Prog
Definition:
prog.h:33
RuntimePrinter
Definition:
runtime_printer.h:20
Generated by
1.8.17