unlogic
Loading...
Searching...
No Matches
IRGenerator.h
Go to the documentation of this file.
1
#ifndef UNLOGIC_IRGENERATOR_H
2
#define UNLOGIC_IRGENERATOR_H
3
4
#include <llvm/IR/IRBuilder.h>
5
#include <stack>
6
#include "
IRGenerationContext.h
"
7
#include "
parser/Node.h
"
8
9
namespace
unlogic
10
{
11
struct
IRGenerator
12
{
13
IRGenerationContext
&
ctx
;
14
llvm::IRBuilder<>
builder
;
15
std::stack<llvm::Value *>
values
;
16
17
llvm::Value *
operator()
(std::monostate &node);
18
llvm::Value *
operator()
(
NumericLiteralNode
&node);
19
llvm::Value *
operator()
(
StringLiteralNode
&node);
20
llvm::Value *
operator()
(
DivisionNode
&node);
21
llvm::Value *
operator()
(
ScopedBlockNode
&node);
22
llvm::Value *
operator()
(
VariableNode
&node);
23
llvm::Value *
operator()
(
CallNode
&node);
24
llvm::Value *
operator()
(
AdditionNode
&node);
25
llvm::Value *
operator()
(
SubtractionNode
&node);
26
llvm::Value *
operator()
(
MultiplicationNode
&node);
27
llvm::Value *
operator()
(
PotentiationNode
&node);
28
llvm::Value *
operator()
(
FunctionDefinitionNode
&node);
29
llvm::Value *
operator()
(
PlotCommandNode
&node);
30
llvm::Value *
operator()
(
ProgramEntryNode
&node);
31
32
IRGenerator
(
IRGenerationContext
&
ctx
) :
ctx
(
ctx
),
builder
(
ctx
.llvm_ctx) {}
33
};
34
}
// namespace unlogic
35
36
#endif
// UNLOGIC_IRGENERATOR_H
IRGenerationContext.h
Node.h
unlogic
Definition
Compiler.h:18
unlogic::AdditionNode
Definition
Node.h:79
unlogic::CallNode
Definition
Node.h:62
unlogic::DivisionNode
Definition
Node.h:97
unlogic::FunctionDefinitionNode
Definition
Node.h:109
unlogic::IRGenerationContext
Definition
IRGenerationContext.h:45
unlogic::IRGenerator
Definition
IRGenerator.h:12
unlogic::IRGenerator::IRGenerator
IRGenerator(IRGenerationContext &ctx)
Definition
IRGenerator.h:32
unlogic::IRGenerator::ctx
IRGenerationContext & ctx
Definition
IRGenerator.h:13
unlogic::IRGenerator::builder
llvm::IRBuilder builder
Definition
IRGenerator.h:14
unlogic::IRGenerator::operator()
llvm::Value * operator()(std::monostate &node)
Definition
IRGenerator.cpp:184
unlogic::IRGenerator::values
std::stack< llvm::Value * > values
Definition
IRGenerator.h:15
unlogic::MultiplicationNode
Definition
Node.h:91
unlogic::NumericLiteralNode
Definition
Node.h:42
unlogic::PlotCommandNode
Definition
Node.h:120
unlogic::PotentiationNode
Definition
Node.h:103
unlogic::ProgramEntryNode
Definition
Node.h:136
unlogic::ScopedBlockNode
Definition
Node.h:128
unlogic::StringLiteralNode
Definition
Node.h:48
unlogic::SubtractionNode
Definition
Node.h:85
unlogic::VariableNode
Definition
Node.h:54
unlogic
src
compiler
transformer
IRGenerator.h
Generated by
1.9.8