Module v.gen.native stdlib

v.gen.native
Version:
0.3.3
License:
MIT
Dependencies from vmod:
0
Imports:
13
Imported by:
1
Repository:
OS-specific
Show selected OS-specific symbols.
Backend-specific
Show selected Backend-specific symbols.

Dependencies defined in v.mod

This section is empty.

Imported by

Aliases

This section is empty.

Constants

#constant inline_builtins

pub const inline_builtins = ['assert', 'print', 'eprint', 'println', 'eprintln', 'exit', 'C.syscall'] // classic V builtin functios accessible to the user get inlined

Sum types

This section is empty.

Functions

#fn gen

fn gen(files []&v.ast.File, table &v.ast.Table, out_name string, pref_ &v.pref.Preferences) (int, int)

#fn macho_test_new_gen

fn macho_test_new_gen(p &v.pref.Preferences, out_name string) &Gen

used in macho_test.v

Structs

#struct Amd64

pub struct Amd64 {
mut:
	g &Gen = unsafe { nil }
	// arm64 specific stuff for code generation
	is_16bit_aligned bool
}

#fn (&Amd64) main_reg

fn (mut c &Amd64) main_reg() Register

#fn (&Amd64) dec

fn (mut c &Amd64) dec(reg Amd64Register)

#fn (&Amd64) inc

fn (mut c &Amd64) inc(reg Amd64Register)

#fn (&Amd64) neg

fn (mut c &Amd64) neg(reg Amd64Register)

#fn (&Amd64) cmp

fn (mut c &Amd64) cmp(reg Amd64Register, size Size, val i64)

#fn (&Amd64) cmp_reg

fn (mut c &Amd64) cmp_reg(reg Amd64Register, reg2 Amd64Register)

cmp rax, rbx

#fn (&Amd64) cmp_zero

fn (mut c &Amd64) cmp_zero(reg Register)

cmp $reg, 0

#fn (&Amd64) cmp_var_reg

fn (mut c &Amd64) cmp_var_reg(var Var, reg Register, config VarConfig)

#fn (&Amd64) cmp_var

fn (mut c &Amd64) cmp_var(var Var, val int, config VarConfig)

#fn (&Amd64) dec_var

fn (mut c &Amd64) dec_var(var Var, config VarConfig)

sub DWORD [rbp-0x4], 1

#fn (&Amd64) inc_var

fn (mut c &Amd64) inc_var(var Var, config VarConfig)

add DWORD [rbp-0x4], 1

#fn (&Amd64) cjmp

fn (mut c &Amd64) cjmp(op JumpOp) int

#fn (&Amd64) jmp

fn (mut c &Amd64) jmp(addr int) int

#fn (&Amd64) jmp_back

fn (mut c &Amd64) jmp_back(start i64)

#fn (&Amd64) cset

fn (mut c &Amd64) cset(op Amd64SetOp)

SETcc al

#fn (&Amd64) tmp_jle

fn (mut c &Amd64) tmp_jle(addr i64)

#fn (&Amd64) jl

fn (mut c &Amd64) jl(addr i64)

#fn (&Amd64) mov32

fn (mut c &Amd64) mov32(reg Amd64Register, val int)

#fn (&Amd64) mov64

fn (mut c &Amd64) mov64(reg Register, val i64)

#fn (&Amd64) movabs

fn (mut c &Amd64) movabs(r Register, val i64)

#fn (&Amd64) mov_deref

fn (mut c &Amd64) mov_deref(reg Amd64Register, regptr Amd64Register, typ v.ast.Type)

#fn (&Amd64) mov_store

fn (mut c &Amd64) mov_store(regptr Amd64Register, reg Amd64Register, size Size)

#fn (&Amd64) mov_reg_to_var

fn (mut c &Amd64) mov_reg_to_var(var Var, r Register, config VarConfig)

#fn (&Amd64) mov_int_to_var

fn (mut c &Amd64) mov_int_to_var(var Var, integer int, config VarConfig)

#fn (&Amd64) lea_var_to_reg

fn (mut c &Amd64) lea_var_to_reg(r Register, var_offset int)

#fn (&Amd64) mov_var_to_reg

fn (mut c &Amd64) mov_var_to_reg(reg Register, var Var, config VarConfig)

#fn (&Amd64) mov_extend_reg

fn (mut c &Amd64) mov_extend_reg(a Amd64Register, b Amd64Register, typ v.ast.Type)

#fn (&Amd64) call_addr_at

fn (mut c &Amd64) call_addr_at(addr int, at i64) i64

#fn (&Amd64) call

fn (mut c &Amd64) call(addr int) i64

#fn (&Amd64) extern_call

fn (mut c &Amd64) extern_call(addr int)

#fn (&Amd64) gen_syscall

fn (mut c &Amd64) gen_syscall(node v.ast.CallExpr)

#fn (&Amd64) syscall

fn (mut c &Amd64) syscall()

#fn (&Amd64) svc

fn (mut c &Amd64) svc()

#fn (&Amd64) cdq

fn (mut c &Amd64) cdq()

#fn (&Amd64) ret

fn (mut c &Amd64) ret()

#fn (&Amd64) push

fn (mut c &Amd64) push(reg Amd64Register)

#fn (&Amd64) pop

fn (mut c &Amd64) pop(reg Amd64Register)

#fn (&Amd64) sub8

fn (mut c &Amd64) sub8(reg Amd64Register, val int)

#fn (&Amd64) sub

fn (mut c &Amd64) sub(reg Amd64Register, val int)

#fn (&Amd64) add

fn (mut c &Amd64) add(reg Amd64Register, val int)

#fn (&Amd64) add8

fn (mut c &Amd64) add8(reg Amd64Register, val int)

#fn (&Amd64) bitand_reg

fn (mut c &Amd64) bitand_reg(a Amd64Register, b Amd64Register)

#fn (&Amd64) bitor_reg

fn (mut c &Amd64) bitor_reg(a Amd64Register, b Amd64Register)

#fn (&Amd64) bitxor_reg

fn (mut c &Amd64) bitxor_reg(a Amd64Register, b Amd64Register)

#fn (&Amd64) bitnot_reg

fn (mut c &Amd64) bitnot_reg(a Amd64Register)

#fn (&Amd64) shl_reg

fn (mut c &Amd64) shl_reg(a Amd64Register, b Amd64Register)

#fn (&Amd64) sar_reg

fn (mut c &Amd64) sar_reg(a Amd64Register, b Amd64Register)

#fn (&Amd64) shr_reg

fn (mut c &Amd64) shr_reg(a Amd64Register, b Amd64Register)

#fn (&Amd64) leave

fn (mut c &Amd64) leave()

#fn (&Amd64) var_zero

fn (mut c &Amd64) var_zero(vo int, size int)

not used?

#fn (&Amd64) rep_stosb

fn (mut c &Amd64) rep_stosb()

#fn (&Amd64) std

fn (mut c &Amd64) std()

#fn (&Amd64) cld

fn (mut c &Amd64) cld()

#fn (&Amd64) cld_repne_scasb

fn (mut c &Amd64) cld_repne_scasb()

#fn (&Amd64) xor

fn (mut c &Amd64) xor(r Amd64Register, v int)

#fn (&Amd64) test_reg

fn (mut c &Amd64) test_reg(r Amd64Register)

#fn (&Amd64) inline_strlen

fn (mut c &Amd64) inline_strlen(r Amd64Register)

return length in .rax of string pointed by given register

#fn (&Amd64) apicall

fn (mut c &Amd64) apicall(call ApiCall)

#fn (&Amd64) gen_print

fn (mut c &Amd64) gen_print(s string, fd int)

#fn (&Amd64) gen_print_reg

fn (mut c &Amd64) gen_print_reg(r Register, n int, fd int)

TODO: strlen of string at runtime

#fn (&Amd64) gen_exit

fn (mut c &Amd64) gen_exit(expr v.ast.Expr)

#fn (&Amd64) relpc

fn (mut c &Amd64) relpc(dst Amd64Register, src Amd64Register)

#fn (&Amd64) learel

fn (mut c &Amd64) learel(reg Register, val int)

#fn (&Amd64) lea

fn (mut c &Amd64) lea(reg Amd64Register, val int)

#fn (&Amd64) mov

fn (mut c &Amd64) mov(r Register, val int)

#fn (&Amd64) mul_reg

fn (mut c &Amd64) mul_reg(a Amd64Register, b Amd64Register)

#fn (&Amd64) imul_reg

fn (mut c &Amd64) imul_reg(r Amd64Register)

#fn (&Amd64) div_reg

fn (mut c &Amd64) div_reg(a Amd64Register, b Amd64Register)

#fn (&Amd64) mod_reg

fn (mut c &Amd64) mod_reg(a Amd64Register, b Amd64Register)

#fn (&Amd64) sub_reg

fn (mut c &Amd64) sub_reg(a Amd64Register, b Amd64Register)

#fn (&Amd64) add_reg

fn (mut c &Amd64) add_reg(a Amd64Register, b Amd64Register)

#fn (&Amd64) mov_reg_amd64

fn (mut c &Amd64) mov_reg_amd64(a Amd64Register, b Amd64Register)

#fn (&Amd64) mov_reg

fn (mut c &Amd64) mov_reg(a Register, b Register)

#fn (&Amd64) add_store

fn (mut c &Amd64) add_store(a Amd64Register, b Amd64Register, size Size)

#fn (&Amd64) sub_store

fn (mut c &Amd64) sub_store(a Amd64Register, b Amd64Register, size Size)

#fn (&Amd64) mul_store

fn (mut c &Amd64) mul_store(a Amd64Register, b Amd64Register, size Size)

#fn (&Amd64) sar8

fn (mut c &Amd64) sar8(r Amd64Register, val u8)

#fn (&Amd64) call_fn

fn (mut c &Amd64) call_fn(node v.ast.CallExpr)

#fn (&Amd64) call_builtin

fn (mut c &Amd64) call_builtin(name Builtin) i64

#fn (&Amd64) for_in_stmt

fn (mut c &Amd64) for_in_stmt(node v.ast.ForInStmt)

#fn (&Amd64) gen_concat_expr

fn (mut c &Amd64) gen_concat_expr(node v.ast.ConcatExpr)

#fn (&Amd64) assign_right_expr

fn (mut c &Amd64) assign_right_expr(node v.ast.AssignStmt, i int, right v.ast.Expr, name string, ident v.ast.Ident)

!!!!!

TODO: this must be done better and platform independant !!!!!

#fn (&Amd64) gen_type_promotion

fn (mut c &Amd64) gen_type_promotion(from v.ast.Type, to v.ast.Type, option Amd64RegisterOption)

#fn (&Amd64) return_stmt

fn (mut c &Amd64) return_stmt(node v.ast.Return)

#fn (&Amd64) multi_assign_stmt

fn (mut c &Amd64) multi_assign_stmt(node v.ast.AssignStmt)

#fn (&Amd64) assign_stmt

fn (mut c &Amd64) assign_stmt(node v.ast.AssignStmt)

#fn (&Amd64) cset_op

fn (mut c &Amd64) cset_op(op v.token.Kind)

#fn (&Amd64) gen_left_value

fn (mut c &Amd64) gen_left_value(node v.ast.Expr)

#fn (&Amd64) prefix_expr

fn (mut c &Amd64) prefix_expr(node v.ast.PrefixExpr)

#fn (&Amd64) infix_expr

fn (mut c &Amd64) infix_expr(node v.ast.InfixExpr)

#fn (&Amd64) trap

fn (mut c &Amd64) trap()

#fn (&Amd64) gen_asm_stmt

fn (mut c &Amd64) gen_asm_stmt(asm_node v.ast.AsmStmt)

#fn (&Amd64) gen_selector_expr

fn (mut c &Amd64) gen_selector_expr(expr v.ast.SelectorExpr)

#fn (&Amd64) gen_assert

fn (mut c &Amd64) gen_assert(assert_node v.ast.AssertStmt)

#fn (&Amd64) cjmp_notop

fn (mut c &Amd64) cjmp_notop(op v.token.Kind) int

#fn (&Amd64) cjmp_op

fn (mut c &Amd64) cjmp_op(op v.token.Kind) int

#fn (&Amd64) infloop

fn (mut c &Amd64) infloop()

#fn (&Amd64) fn_decl

fn (mut c &Amd64) fn_decl(node v.ast.FnDecl)

#fn (&Amd64) builtin_decl

fn (mut c &Amd64) builtin_decl(builtin BuiltinFn)

#fn (&Amd64) allocate_var_two_step

fn (mut c &Amd64) allocate_var_two_step(name string, size int, initial_val int) int

#fn (&Amd64) allocate_var

fn (mut c &Amd64) allocate_var(name string, size int, initial_val int) int

#fn (&Amd64) init_struct

fn (mut c &Amd64) init_struct(var Var, init v.ast.StructInit)

#fn (&Amd64) convert_bool_to_string

fn (mut c &Amd64) convert_bool_to_string(r Register)

#fn (&Amd64) convert_rune_to_string

fn (mut c &Amd64) convert_rune_to_string(reg Register, buffer int, var Var, config VarConfig)

#fn (&Amd64) convert_int_to_string

fn (mut c &Amd64) convert_int_to_string(a Register, b Register)

#fn (&Amd64) reverse_string

fn (mut c &Amd64) reverse_string(r Register)

#fn (&Amd64) gen_match_expr

fn (mut c &Amd64) gen_match_expr(expr v.ast.MatchExpr)

#fn (&Amd64) mov_ssereg_to_var

fn (mut c &Amd64) mov_ssereg_to_var(var Var, reg Amd64SSERegister, config VarConfig)

#fn (&Amd64) load_fp_var

fn (mut c &Amd64) load_fp_var(var Var, config VarConfig)

#fn (&Amd64) mov_var_to_ssereg

fn (mut c &Amd64) mov_var_to_ssereg(reg Amd64SSERegister, var Var, config VarConfig)

#fn (&Amd64) mov_ssereg

fn (mut c &Amd64) mov_ssereg(a Amd64SSERegister, b Amd64SSERegister)

#fn (&Amd64) mov_ssereg_to_reg

fn (mut c &Amd64) mov_ssereg_to_reg(a Amd64Register, b Amd64SSERegister, typ v.ast.Type)

#fn (&Amd64) load_fp

fn (mut c &Amd64) load_fp(f f64)

#fn (&Amd64) mov_reg_to_ssereg

fn (mut c &Amd64) mov_reg_to_ssereg(a Amd64SSERegister, b Amd64Register, typ v.ast.Type)

#fn (&Amd64) mov_deref_sse

fn (mut c &Amd64) mov_deref_sse(a Amd64SSERegister, b Amd64Register, typ v.ast.Type)

#fn (&Amd64) add_sse

fn (mut c &Amd64) add_sse(a Amd64SSERegister, b Amd64SSERegister, typ v.ast.Type)

#fn (&Amd64) sub_sse

fn (mut c &Amd64) sub_sse(a Amd64SSERegister, b Amd64SSERegister, typ v.ast.Type)

#fn (&Amd64) mul_sse

fn (mut c &Amd64) mul_sse(a Amd64SSERegister, b Amd64SSERegister, typ v.ast.Type)

#fn (&Amd64) div_sse

fn (mut c &Amd64) div_sse(a Amd64SSERegister, b Amd64SSERegister, typ v.ast.Type)

#fn (&Amd64) cmp_sse

fn (mut c &Amd64) cmp_sse(a Amd64SSERegister, b Amd64SSERegister, typ v.ast.Type)

#fn (&Amd64) push_sse

fn (mut c &Amd64) push_sse(reg Amd64SSERegister)

#fn (&Amd64) pop_sse

fn (mut c &Amd64) pop_sse(reg Amd64SSERegister)

#fn (&Amd64) gen_cast_expr

fn (mut c &Amd64) gen_cast_expr(expr v.ast.CastExpr)

#fn (&Amd64) adr

fn (mut c &Amd64) adr(r Arm64Register, delta int)

Temporary!

#struct Arm64

pub struct Arm64 {
mut:
	g &Gen = unsafe { nil }
	// arm64 specific stuff for code generation
}

#fn (&Arm64) allocate_var

fn (mut x &Arm64) allocate_var(name string, size int, initial_val int) int

#fn (&Arm64) mov

fn (mut c &Arm64) mov(reg Register, val int)

#fn (&Arm64) mov_arm

fn (mut c &Arm64) mov_arm(reg Arm64Register, val u64)

#fn (&Arm64) neg

fn (mut c &Arm64) neg(r Arm64Register)

#fn (&Arm64) neg_regs

fn (mut c &Arm64) neg_regs(a Arm64Register, b Arm64Register)

#fn (&Arm64) sub_sp

fn (mut c &Arm64) sub_sp(v int)

#fn (&Arm64) fn_decl

fn (mut c &Arm64) fn_decl(node v.ast.FnDecl)

#fn (&Arm64) call_fn

fn (mut c &Arm64) call_fn(node v.ast.CallExpr)

#fn (&Arm64) adr

fn (mut c &Arm64) adr(r Arm64Register, delta int)

#fn (&Arm64) bl

fn (mut c &Arm64) bl()

#fn (&Arm64) svc

fn (mut c &Arm64) svc()

#fn (&Arm64) syscall

fn (mut c &Arm64) syscall()

#fn (&Arm64) gen_exit

fn (mut c &Arm64) gen_exit(expr v.ast.Expr)

#fn (&Arm64) gen_arm64_exit

fn (mut c &Arm64) gen_arm64_exit(expr v.ast.Expr)

#fn (&Arm64) gen_print

fn (mut c &Arm64) gen_print(s string, fd int)

#fn (&Arm64) gen_print_reg

fn (mut c &Arm64) gen_print_reg(r Register, n int, fd int)

#fn (&Arm64) learel

fn (mut c &Arm64) learel(reg Register, val int)

#fn (&Arm64) lea_var_to_reg

fn (mut c &Arm64) lea_var_to_reg(reg Register, var_offset int)

#fn (&Arm64) main_reg

fn (mut c &Arm64) main_reg() Register

#fn (&Arm64) gen_match_expr

fn (mut c &Arm64) gen_match_expr(expr v.ast.MatchExpr)

#fn (&Arm64) convert_int_to_string

fn (mut c &Arm64) convert_int_to_string(a Register, b Register)

#fn (&Arm64) convert_bool_to_string

fn (mut c &Arm64) convert_bool_to_string(r Register)

#fn (&Arm64) reverse_string

fn (mut c &Arm64) reverse_string(r Register)

#fn (&Arm64) mov_var_to_reg

fn (mut c &Arm64) mov_var_to_reg(reg Register, var Var, config VarConfig)

#fn (&Arm64) mov_reg

fn (mut c &Arm64) mov_reg(r1 Register, r2 Register)

#fn (&Arm64) mov64

fn (mut c &Arm64) mov64(r Register, val i64)

#fn (&Arm64) convert_rune_to_string

fn (mut c &Arm64) convert_rune_to_string(r Register, buffer int, var Var, config VarConfig)

#fn (&Arm64) apicall

fn (mut c &Arm64) apicall(call ApiCall)

#fn (&Arm64) trap

fn (mut c &Arm64) trap()

#fn (&Arm64) leave

fn (mut c &Arm64) leave()

#fn (&Arm64) ret

fn (mut c &Arm64) ret()

#fn (&Arm64) assign_stmt

fn (mut c &Arm64) assign_stmt(node v.ast.AssignStmt)

#fn (&Arm64) builtin_decl

fn (mut c &Arm64) builtin_decl(builtin BuiltinFn)

#fn (&Arm64) infix_expr

fn (mut c &Arm64) infix_expr(node v.ast.InfixExpr)

#fn (&Arm64) return_stmt

fn (mut c &Arm64) return_stmt(node v.ast.Return)

#fn (&Arm64) gen_cast_expr

fn (mut c &Arm64) gen_cast_expr(expr v.ast.CastExpr)

#fn (&Arm64) prefix_expr

fn (mut c &Arm64) prefix_expr(expr v.ast.PrefixExpr)

#fn (&Arm64) call_builtin

fn (mut c &Arm64) call_builtin(name Builtin) i64

#fn (&Arm64) gen_asm_stmt

fn (mut c &Arm64) gen_asm_stmt(asm_node v.ast.AsmStmt)

#fn (&Arm64) gen_assert

fn (mut c &Arm64) gen_assert(assert_node v.ast.AssertStmt)

#fn (&Arm64) infloop

fn (mut c &Arm64) infloop()

#fn (&Arm64) jmp_back

fn (mut c &Arm64) jmp_back(start i64)

#fn (&Arm64) init_struct

fn (mut c &Arm64) init_struct(var Var, init v.ast.StructInit)

#fn (&Arm64) load_fp_var

fn (mut c &Arm64) load_fp_var(var Var, config VarConfig)

#fn (&Arm64) load_fp

fn (mut c &Arm64) load_fp(val f64)

#fn (&Arm64) for_in_stmt

fn (mut c &Arm64) for_in_stmt(node v.ast.ForInStmt)

#fn (&Arm64) cmp_zero

fn (mut c &Arm64) cmp_zero(reg Register)

#fn (&Arm64) cmp_var_reg

fn (mut c &Arm64) cmp_var_reg(var Var, reg Register, config VarConfig)

#fn (&Arm64) cmp_var

fn (mut c &Arm64) cmp_var(var Var, val int, config VarConfig)

#fn (&Arm64) dec_var

fn (mut c &Arm64) dec_var(var Var, config VarConfig)

#fn (&Arm64) inc_var

fn (mut c &Arm64) inc_var(var Var, config VarConfig)

#fn (&Arm64) cjmp

fn (mut c &Arm64) cjmp(op JumpOp) int

#fn (&Arm64) jmp

fn (mut c &Arm64) jmp(addr int) int

#fn (&Arm64) gen_syscall

fn (mut c &Arm64) gen_syscall(node v.ast.CallExpr)

#fn (&Arm64) movabs

fn (mut c &Arm64) movabs(reg Register, val i64)

#fn (&Arm64) gen_selector_expr

fn (mut c &Arm64) gen_selector_expr(expr v.ast.SelectorExpr)

#fn (&Arm64) mov_reg_to_var

fn (mut c &Arm64) mov_reg_to_var(var Var, reg Register, config VarConfig)

#fn (&Arm64) mov_int_to_var

fn (mut c &Arm64) mov_int_to_var(var Var, integer int, config VarConfig)

#fn (&Arm64) call

fn (mut c &Arm64) call(addr int) i64

#fn (&Arm64) call_addr_at

fn (mut c &Arm64) call_addr_at(addr int, at i64) i64

#fn (&Arm64) gen_concat_expr

fn (mut c &Arm64) gen_concat_expr(expr v.ast.ConcatExpr)

#struct Gen

heapminify
pub struct Gen {
	out_name string
	pref     &pref.Preferences = unsafe { nil } // Preferences shared from V struct
	files    []&ast.File
mut:
	code_gen             CodeGen
	table                &ast.Table = unsafe { nil }
	buf                  []u8
	sect_header_name_pos int
	offset               i64
	file_size_pos        i64
	elf_text_header_addr i64 = -1
	elf_rela_section     Section
	main_fn_addr         i64
	main_fn_size         i64
	start_symbol_addr    i64
	code_start_pos       i64 // location of the start of the assembly instructions
	symbol_table         []SymbolTableSection
	extern_symbols       []string
	extern_fn_calls      map[i64]string
	fn_addr              map[string]i64
	var_offset           map[string]int // local var stack offset
	var_alloc_size       map[string]int // local var allocation size
	stack_var_pos        int
	debug_pos            int
	errors               []errors.Error
	warnings             []errors.Warning
	syms                 []Symbol
	size_pos             []int
	nlines               int
	callpatches          []CallPatch
	strs                 []String
	labels               &LabelTable = unsafe { nil }
	defer_stmts          []ast.DeferStmt
	builtins             map[Builtin]BuiltinFn
	structs              []Struct
	eval                 eval.Eval
	enum_vals            map[string]Enum
	return_type          ast.Type
	// macho specific
	macho_ncmds   int
	macho_cmdsize int

	requires_linking bool
}

#fn (&Gen) gen_arm64_helloworld

fn (mut g &Gen) gen_arm64_helloworld()

#fn (&Gen) gen_asm_stmt_arm64

fn (mut g &Gen) gen_asm_stmt_arm64(asm_node v.ast.AsmStmt)

#fn (&Gen) init_builtins

fn (mut g &Gen) init_builtins()

#fn (&Gen) generate_builtins

fn (mut g &Gen) generate_builtins()

#fn (&Gen) get_builtin_arg_reg

fn (mut g &Gen) get_builtin_arg_reg(name Builtin, index int) Register

#fn (&Gen) call_builtin

fn (mut g &Gen) call_builtin(name Builtin)

#fn (&Gen) comptime_at

fn (mut g &Gen) comptime_at(node v.ast.AtExpr) string

#fn (&Gen) comptime_conditional

fn (mut g &Gen) comptime_conditional(node v.ast.IfExpr) ?[]v.ast.Stmt

#fn (&Gen) comptime_is_truthy

fn (mut g &Gen) comptime_is_truthy(cond v.ast.Expr) bool

#fn (&Gen) comptime_ident

fn (mut g &Gen) comptime_ident(name string, is_comptime_option bool) bool

#fn (&Gen) default_elf_header

fn (mut g &Gen) default_elf_header() ElfHeader

#fn (&Gen) gen_elf_header

fn (mut g &Gen) gen_elf_header(h ElfHeader)

#fn (&Gen) create_program_header

fn (mut g &Gen) create_program_header(typ int, flags int, align i64) ProgramHeader

#fn (&Gen) gen_program_header

fn (mut g &Gen) gen_program_header(p ProgramHeader)

#fn (&Gen) create_symbol_table_section

fn (mut g &Gen) create_symbol_table_section(str_name string, info u8, bind u8, other i8, value i64, size i64, shndx i16) SymbolTableSection

#fn (&Gen) create_string_table_section

fn (mut g &Gen) create_string_table_section(strings []string) StringTableSection

#fn (&Gen) create_progbits_section

fn (mut g &Gen) create_progbits_section(bytes []u8) ProgBitsSection

#fn (&Gen) create_rela_section

fn (mut g &Gen) create_rela_section(name string, offset i64, sym int, typ u32, addend i64) RelASection

#fn (&Gen) create_hash_section

fn (mut g &Gen) create_hash_section() HashSection

#fn (&Gen) create_dynamic_section

fn (mut g &Gen) create_dynamic_section(tag i64, val i64) DynamicSection

#fn (&Gen) create_note_section

fn (mut g &Gen) create_note_section(typ int, name string, desc string) NoteSection

#fn (&Gen) chreate_nobits_section

fn (mut g &Gen) chreate_nobits_section() NoBitsSection

#fn (&Gen) create_rel_section

fn (mut g &Gen) create_rel_section(offset i64, sym u32, typ u32) RelSection

#fn (&Gen) create_shlib_section

fn (mut g &Gen) create_shlib_section(data []u8) ShLibSection

#fn (&Gen) create_dynsym_section

fn (mut g &Gen) create_dynsym_section(symbols []SymbolTableSection) DynSymSection

#fn (&Gen) create_section

fn (mut g &Gen) create_section(name string, typ int, link int, info int, addralign i64, entsize i64, data SectionData) Section

#fn (&Gen) create_shstrtab

fn (mut g &Gen) create_shstrtab(mut sections &[]Section)

#fn (&Gen) create_symtab

fn (mut g &Gen) create_symtab(mut sections &[]Section, mut table &[]SymbolTableSection)

#fn (&Gen) create_relocation

fn (mut g &Gen) create_relocation(name string, mut sections &[]Section, table []RelASection) Section

#fn (&Gen) create_progbits

fn (mut g &Gen) create_progbits(name string, flags u64, data []u8) Section

#fn (&Gen) find_section_header

fn (mut g &Gen) find_section_header(name string, sections []Section) int

#fn (&Gen) gen_section_header

fn (mut g &Gen) gen_section_header(mut sh &SectionHeader)

#fn (&Gen) gen_sections

fn (mut g &Gen) gen_sections(mut sections &[]Section)

#fn (&Gen) gen_symtab_data

fn (mut g &Gen) gen_symtab_data(section Section, data []SymbolTableSection)

#fn (&Gen) gen_section_data

fn (mut g &Gen) gen_section_data(sections []Section)

#fn (&Gen) symtab_get_index

fn (mut g &Gen) symtab_get_index(symbols []SymbolTableSection, name string) int

#fn (&Gen) generate_linkable_elf_header

fn (mut g &Gen) generate_linkable_elf_header()

#fn (&Gen) generate_simple_elf_header

fn (mut g &Gen) generate_simple_elf_header()

#fn (&Gen) elf_string_table

fn (mut g &Gen) elf_string_table()

#fn (&Gen) gen_rela_section

fn (mut g &Gen) gen_rela_section()

#fn (&Gen) prepend_vobjpath

fn (mut g &Gen) prepend_vobjpath(paths []string) []string

#fn (&Gen) find_o_path

fn (mut g &Gen) find_o_path(fname string) string

#fn (&Gen) get_lpaths

fn (mut g &Gen) get_lpaths() string

#fn (&Gen) get_var_from_ident

fn (mut g &Gen) get_var_from_ident(ident v.ast.Ident) IdentVar

#fn (&Gen) get_type_from_var

fn (mut g &Gen) get_type_from_var(var Var) v.ast.Type

#fn (&Gen) typ

fn (mut g &Gen) typ(a int) &v.ast.TypeSymbol

#fn (&Gen) ast_has_external_functions

fn (mut g &Gen) ast_has_external_functions() bool

#fn (&Gen) generate_header

fn (mut g &Gen) generate_header()

#fn (&Gen) create_executable

fn (mut g &Gen) create_executable()

#fn (&Gen) calculate_all_size_align

fn (mut g &Gen) calculate_all_size_align()

#fn (&Gen) calculate_enum_fields

fn (mut g &Gen) calculate_enum_fields()

#fn (&Gen) stmts

fn (mut g &Gen) stmts(stmts []v.ast.Stmt)

#fn (&Gen) pos

fn (g &Gen) pos() i64

#fn (&Gen) write

fn (mut g &Gen) write(bytes []u8)

#fn (&Gen) write8

fn (mut g &Gen) write8(n int)

#fn (&Gen) write16

fn (mut g &Gen) write16(n int)

#fn (&Gen) read32_at

fn (mut g &Gen) read32_at(at int) int

#fn (&Gen) write32

fn (mut g &Gen) write32(n int)

#fn (&Gen) write64

fn (mut g &Gen) write64(n i64)

#fn (&Gen) write64_at

fn (mut g &Gen) write64_at(at i64, n i64)

#fn (&Gen) write32_at

fn (mut g &Gen) write32_at(at i64, n int)

#fn (&Gen) write16_at

fn (mut g &Gen) write16_at(at i64, n int)

#fn (&Gen) write_string

fn (mut g &Gen) write_string(s string)

#fn (&Gen) write_string_with_padding

fn (mut g &Gen) write_string_with_padding(s string, max int)

#fn (&Gen) abs_to_rel_addr

fn (g &Gen) abs_to_rel_addr(addr i64) int

#fn (&Gen) try_var_offset

fn (mut g &Gen) try_var_offset(var_name string) int

#fn (&Gen) get_var_offset

fn (mut g &Gen) get_var_offset(var_name string) int

#fn (&Gen) get_field_offset

fn (mut g &Gen) get_field_offset(typ v.ast.Type, name string) int

#fn (&Gen) get_type_size

fn (mut g &Gen) get_type_size(typ v.ast.Type) int

get type size, and calculate size and align and store them to the cache when the type is struct

#fn (&Gen) get_type_align

fn (mut g &Gen) get_type_align(typ v.ast.Type) int

#fn (&Gen) get_multi_return

fn (mut g &Gen) get_multi_return(types []v.ast.Type) MultiReturn

#fn (&Gen) is_register_type

fn (g &Gen) is_register_type(typ v.ast.Type) bool

#fn (&Gen) get_sizeof_ident

fn (mut g &Gen) get_sizeof_ident(ident v.ast.Ident) int

#fn (&Gen) allocate_by_type

fn (mut g &Gen) allocate_by_type(name string, typ v.ast.Type) int

#fn (&Gen) allocate_string

fn (mut g &Gen) allocate_string(s string, opsize int, typ RelocType) int

#fn (&Gen) allocate_array

fn (mut g &Gen) allocate_array(name string, size int, items int) int

#fn (&Gen) gen_typeof_expr

fn (mut g &Gen) gen_typeof_expr(it v.ast.TypeOf, newline bool)

#fn (&Gen) eval_str_lit_escape_codes

fn (mut g &Gen) eval_str_lit_escape_codes(str_lit v.ast.StringLiteral) string

#fn (&Gen) eval_escape_codes

fn (mut g &Gen) eval_escape_codes(str string) string

#fn (&Gen) gen_to_string

fn (mut g &Gen) gen_to_string(reg Register, typ v.ast.Type)

#fn (&Gen) gen_var_to_string

fn (mut g &Gen) gen_var_to_string(reg Register, expr v.ast.Expr, var Var, config VarConfig)

#fn (&Gen) gen_print_from_expr

fn (mut g &Gen) gen_print_from_expr(expr v.ast.Expr, typ v.ast.Type, name string)

#fn (&Gen) is_used_by_main

fn (mut g &Gen) is_used_by_main(node v.ast.FnDecl) bool

#fn (&Gen) patch_calls

fn (mut g &Gen) patch_calls()

#fn (&Gen) patch_labels

fn (mut g &Gen) patch_labels()

#fn (&Gen) delay_fn_call

fn (mut g &Gen) delay_fn_call(name string)

#fn (&Gen) fn_decl

fn (mut g &Gen) fn_decl(node v.ast.FnDecl)

#fn (&Gen) register_function_address

fn (mut g &Gen) register_function_address(name string)

#fn (&Gen) println

fn (mut g &Gen) println(comment string)

#fn (&Gen) gen_forc_stmt

fn (mut g &Gen) gen_forc_stmt(node v.ast.ForCStmt)

#fn (&Gen) for_stmt

fn (mut g &Gen) for_stmt(node v.ast.ForStmt)

#fn (&Gen) stmt

fn (mut g &Gen) stmt(node v.ast.Stmt)

#fn (&Gen) expr

fn (mut g &Gen) expr(node v.ast.Expr)

#fn (&Gen) condition

fn (mut g &Gen) condition(expr v.ast.Expr, neg bool) int

#fn (&Gen) if_expr

fn (mut g &Gen) if_expr(node v.ast.IfExpr)

#fn (&Gen) postfix_expr

fn (mut g &Gen) postfix_expr(node v.ast.PostfixExpr)

#fn (&Gen) n_error

noreturn
fn (mut g &Gen) n_error(s string)

#fn (&Gen) warning

fn (mut g &Gen) warning(s string, pos v.token.Pos)

#fn (&Gen) v_error

fn (mut g &Gen) v_error(s string, pos v.token.Pos)

#fn (&Gen) macho_segment64_pagezero

fn (mut g &Gen) macho_segment64_pagezero()

#fn (&Gen) macho_add_loadcommand

fn (mut g &Gen) macho_add_loadcommand(typ u32, size int)

#fn (&Gen) macho_patch_header

fn (mut g &Gen) macho_patch_header()

#fn (&Gen) macho_chained_fixups

fn (mut g &Gen) macho_chained_fixups()

probably unnecessary

#fn (&Gen) macho_segment64_linkedit

fn (mut g &Gen) macho_segment64_linkedit()

#fn (&Gen) macho_header

fn (mut g &Gen) macho_header(ncmds int, bintype int) int

#fn (&Gen) macho_segment64_text

fn (mut g &Gen) macho_segment64_text() []int

#fn (&Gen) macho_symtab

fn (mut g &Gen) macho_symtab()

#fn (&Gen) macho_dylibs

fn (mut g &Gen) macho_dylibs()

#fn (&Gen) macho_main

fn (mut g &Gen) macho_main(addr int)

#fn (&Gen) generate_macho_header

fn (mut g &Gen) generate_macho_header()

#fn (&Gen) get_pagesize

fn (mut g &Gen) get_pagesize() int

#fn (&Gen) write_nulls

fn (mut g &Gen) write_nulls(len int)

#fn (&Gen) generate_macho_object_header

fn (mut g &Gen) generate_macho_object_header()

#fn (&Gen) sym_table_command

fn (mut g &Gen) sym_table_command()

#fn (&Gen) zeroes

fn (mut g &Gen) zeroes(n int)

#fn (&Gen) write_relocs

fn (mut g &Gen) write_relocs()

#fn (&Gen) sym_table

fn (mut g &Gen) sym_table()

#fn (&Gen) write_symbol

fn (mut g &Gen) write_symbol(s Symbol)

#fn (&Gen) sym_string_table

fn (mut g &Gen) sym_string_table() int

#fn (&Gen) write_dos_header

fn (mut g &Gen) write_dos_header()

#fn (&Gen) write_dos_stub

fn (mut g &Gen) write_dos_stub()

size is 0xb8

#fn (&Gen) write_pe_sections

fn (mut g &Gen) write_pe_sections()

#fn (&Gen) write_pe_header

fn (mut g &Gen) write_pe_header()

#fn (&Gen) write_pe_section

fn (mut g &Gen) write_pe_section()

#fn (&Gen) generate_pe_header

fn (mut g &Gen) generate_pe_header()

#fn (&Gen) nsyscall_macos

fn (mut g &Gen) nsyscall_macos(syscall SysCall) int

#fn (&Gen) nsyscall_linux

fn (mut g &Gen) nsyscall_linux(syscall SysCall) int

#fn (&Gen) nsyscall

fn (mut g &Gen) nsyscall(syscall SysCall) int

Interfaces

This section is empty.

Enums

This section is empty.