34 lines
648 B
C++
34 lines
648 B
C++
#ifndef CODEGEN_H
|
|
#define CODEGEN_H
|
|
|
|
#include <memory>
|
|
#include <llvm/IR/LLVMContext.h>
|
|
#include <llvm/IR/IRBuilder.h>
|
|
#include <map>
|
|
|
|
#include "builder.h"
|
|
#include "types.h"
|
|
#include "binops.h"
|
|
#include "casting.h"
|
|
#include "tokens.h"
|
|
|
|
namespace codegen {
|
|
struct StackValue {
|
|
llvm::Value* value = nullptr;
|
|
std::shared_ptr<types::Type> ty = nullptr;
|
|
};
|
|
|
|
struct Scope {
|
|
std::vector<types::BinopDefinition>& binops;
|
|
std::vector<types::CastDefinition>& casts;
|
|
|
|
TypeMap structs;
|
|
std::map<std::string, StackValue> values;
|
|
|
|
bool is_lvalue;
|
|
|
|
Scope with_lvalue();
|
|
};
|
|
}
|
|
|
|
#endif |