blog-static/code/compiler/08/llvm_context.cpp

19 lines
786 B
C++

#include "llvm_context.hpp"
#include <llvm/IR/DerivedTypes.h>
void llvm_state::create_types() {
stack_type = llvm::StructType::create(ctx, "stack");
tag_type = llvm::IntegerType::getInt8Ty(ctx);
struct_types["node_base"] = llvm::StructType::create(ctx, "node_base");
struct_types["node_app"] = llvm::StructType::create(ctx, "node_app");
struct_types["node_num"] = llvm::StructType::create(ctx, "node_num");
struct_types["node_global"] = llvm::StructType::create(ctx, "node_global");
struct_types["node_ind"] = llvm::StructType::create(ctx, "node_ind");
struct_types["node_data"] = llvm::StructType::create(ctx, "node_data");
node_ptr_type = llvm::PointerType::getUnqual(struct_types.at("node_base"));
}
void llvm_state::create_functions() {
}