Luma 0.1.0
A low-level compiled alternative to C, C++, and more!
Loading...
Searching...
No Matches
Functions
helpers.c File Reference
#include "../llvm.h"
#include "../../c_libs/error/error.h"
#include <stdarg.h>
#include <stdlib.h>
Include dependency graph for helpers.c:

Functions

LLVMValueRef alloca_and_store (CodeGenContext *ctx, LLVMTypeRef type, LLVMValueRef value, const char *name)
 
LLVMValueRef struct_gep_load (CodeGenContext *ctx, LLVMTypeRef struct_type, LLVMValueRef ptr, unsigned index, LLVMTypeRef element_type, const char *name)
 
void struct_gep_store (CodeGenContext *ctx, LLVMTypeRef struct_type, LLVMValueRef ptr, unsigned index, LLVMValueRef value)
 
LLVMValueRef array_gep (CodeGenContext *ctx, LLVMTypeRef array_type, LLVMValueRef array_ptr, LLVMValueRef index, const char *name)
 
bool block_has_terminator (LLVMBuilderRef builder)
 
void branch_if_no_terminator (CodeGenContext *ctx, LLVMBasicBlockRef target)
 
LLVMValueRef build_global_string (CodeGenContext *ctx, const char *str, const char *name)
 
void cg_error (CodeGenContext *ctx, AstNode *node, const char *error_type, const char *format,...)
 
void cg_error_help (CodeGenContext *ctx, AstNode *node, const char *error_type, const char *help, const char *format,...)
 

Function Documentation

◆ alloca_and_store()

LLVMValueRef alloca_and_store ( CodeGenContext *  ctx,
LLVMTypeRef  type,
LLVMValueRef  value,
const char *  name 
)

◆ array_gep()

LLVMValueRef array_gep ( CodeGenContext *  ctx,
LLVMTypeRef  array_type,
LLVMValueRef  array_ptr,
LLVMValueRef  index,
const char *  name 
)

◆ block_has_terminator()

bool block_has_terminator ( LLVMBuilderRef  builder)

◆ branch_if_no_terminator()

void branch_if_no_terminator ( CodeGenContext *  ctx,
LLVMBasicBlockRef  target 
)

◆ build_global_string()

LLVMValueRef build_global_string ( CodeGenContext *  ctx,
const char *  str,
const char *  name 
)

◆ cg_error()

void cg_error ( CodeGenContext *  ctx,
AstNode *  node,
const char *  error_type,
const char *  format,
  ... 
)

◆ cg_error_help()

void cg_error_help ( CodeGenContext *  ctx,
AstNode *  node,
const char *  error_type,
const char *  help,
const char *  format,
  ... 
)

◆ struct_gep_load()

LLVMValueRef struct_gep_load ( CodeGenContext *  ctx,
LLVMTypeRef  struct_type,
LLVMValueRef  ptr,
unsigned  index,
LLVMTypeRef  element_type,
const char *  name 
)

◆ struct_gep_store()

void struct_gep_store ( CodeGenContext *  ctx,
LLVMTypeRef  struct_type,
LLVMValueRef  ptr,
unsigned  index,
LLVMValueRef  value 
)