Gyoji Compiler
Loading...
Searching...
No Matches
src
codegen
gyoji-codegen.hpp
1
/* Copyright 2025 Jonathan S. Arney
2
*
3
* Licensed under the Apache License, Version 2.0 (the "License");
4
* you may not use this file except in compliance with the License.
5
* You may obtain a copy of the License at
6
*
7
* https://github.com/jarney/gyoji/blob/master/LICENSE
8
*
9
* Unless required by applicable law or agreed to in writing, software
10
* distributed under the License is distributed on an "AS IS" BASIS,
11
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12
* See the License for the specific language governing permissions and
13
* limitations under the License.
14
*/
15
#pragma once
16
17
#include <gyoji-misc/pointers.hpp>
18
#include <gyoji-mir.hpp>
19
20
namespace
Gyoji::codegen {
21
class
CodeGeneratorLLVMContext;
22
30
class
CodeGeneratorLLVM
{
31
public
:
32
CodeGeneratorLLVM
(
33
const
Gyoji::context::CompilerContext
& _compiler_context,
34
const
Gyoji::mir::MIR
& _mir
35
);
36
~CodeGeneratorLLVM
();
37
void
initialize();
38
void
generate();
39
int
output(
const
std::string
& filename);
40
private
:
41
Gyoji::owned<CodeGeneratorLLVMContext>
context;
42
43
};
44
45
void
generate_code(
const
Gyoji::context::CompilerContext
& _context,
const
Gyoji::mir::MIR
& _mir,
const
std::string
& _filename);
46
};
std::basic_string
std::unique_ptr
Gyoji::codegen::CodeGeneratorLLVM
Definition
gyoji-codegen.hpp:30
Gyoji::context::CompilerContext
Compiler Context.
Definition
gyoji-context.hpp:44
Gyoji::mir::MIR
The middle-tier intermediate representation (MIR) of a translation unit.
Definition
gyoji-mir.hpp:71
Generated by
1.9.8