Skip to content

class Crystal::CodeGenVisitor
inherits Crystal::Visitor

Included modules

Crystal::LLVMBuilderHelper

Constants

CPP_LANG_DEBUG_IDENTIFIER = 4_u32

We have to use it because LLDB has builtin type system support for C++/clang that we can use for now for free. Later on we can implement LLDB Crystal type system so we can get official Language ID

CRYSTAL_LANG_DEBUG_IDENTIFIER = 40_u32

ONCE_STATE = "~ONCE_STATE"

SYMBOL_TABLE_NAME = ":symbol_table"

Class methods

.new(program : Program, node : ASTNode, single_module = false, debug = Debug::Default)

View source

Methods

#abi_info(external : Def, node : Call)

View source

#abi_info(external : Def)

View source

#accept(node)

View source

#accept_control_expression(node)

View source

#aggregate_index(ptr, index)

View source

#alloca(type, name = "")

View source

#alloca_block : LLVM::BasicBlock

View source

#alloca_non_closured_vars(vars, obj = nil, args = nil, reset_nilable_vars = true)

View source

#alloca_vars(vars, obj = nil, args = nil, parent_context = nil, reset_nilable_vars = true)

View source

#allocate_aggregate(type)

View source

#allocate_tuple

View source

#array_malloc(type, count)

View source

#array_malloc_atomic(type, count)

View source

#assign(target_pointer, target_type, value_type, value)

View source

#assign_distinct(target_pointer, target_type : NilableProcType, value_type : TypeDefType, value)

View source

#assign_distinct(target_pointer, target_type : Type, value_type : Type, value)

View source

#assign_distinct(target_pointer, target_type : ProcInstanceType, value_type : MixedUnionType, value)

View source

#assign_distinct(target_pointer, target_type : ProcInstanceType, value_type : ProcInstanceType, value)

View source

#assign_distinct(target_pointer, target_type : NilableType, value_type : Type, value)

View source

#assign_distinct(target_pointer, target_type : ReferenceUnionType, value_type : ReferenceUnionType, value)

View source

#assign_distinct(target_pointer, target_type : ReferenceUnionType, value_type : VirtualType, value)

View source

#assign_distinct(target_pointer, target_type : ReferenceUnionType, value_type : Type, value)

View source

#assign_distinct(target_pointer, target_type : NilableReferenceUnionType, value_type : Type, value)

View source

#assign_distinct(target_pointer, target_type : MixedUnionType, value_type : MixedUnionType, value)

View source

#assign_distinct(target_pointer, target_type : MixedUnionType, value_type : NilableType, value)

View source

#assign_distinct(target_pointer, target_type : MixedUnionType, value_type : VoidType, value)

View source

#assign_distinct(target_pointer, target_type : NamedTupleInstanceType, value_type : NamedTupleInstanceType, value)

View source

#assign_distinct(target_pointer, target_type : NilableProcType, value_type : ProcInstanceType, value)

View source

#assign_distinct(target_pointer, target_type : NilableProcType, value_type : NilType, value)

View source

#assign_distinct(target_pointer, target_type : VirtualMetaclassType, value_type : UnionType, value)

View source

#assign_distinct(target_pointer, target_type : VirtualMetaclassType, value_type : VirtualMetaclassType, value)

View source

#assign_distinct(target_pointer, target_type : VirtualMetaclassType, value_type : MetaclassType, value)

View source

#assign_distinct(target_pointer, target_type : VirtualType, value_type : Type, value)

View source

#assign_distinct(target_pointer, target_type : VirtualType, value_type : MixedUnionType, value)

View source

#assign_distinct(target_pointer, target_type : TupleInstanceType, value_type : TupleInstanceType, value)

View source

#assign_distinct(target_pointer, target_type : MixedUnionType, value_type : NilType, value)

View source

#assign_distinct(target_pointer, target_type : MixedUnionType, value_type : BoolType, value)

View source

#assign_distinct(target_pointer, target_type : MixedUnionType, value_type : Type, value)

View source

#assign_distinct_union_types(target_pointer, target_type, value_type, value)

View source

#atomic_ordering_from_symbol_literal(node)

View source

#atomicrwm_bin_op_from_symbol_literal(node)

View source

#autocast_literal?(call_arg)

View source

#bool_from_bool_literal(node)

View source

#bound_to_mod_nil?(var)

View source

#br_block_chain(*blocks)

View source

#br_from_alloca_to_entry

View source

#build_string_constant(str, name = "str")

View source

#c_malloc_fun

View source

#c_realloc_fun

View source

#call_abi_info(target_def, node)

View source

#call_c_malloc(size)

View source

#call_c_realloc(buffer, size)

View source

#cant_pass_closure_to_c_exception_call

View source

#check_assign_to_special_var_in_block(target, value)

View source

#check_atomic_call(call, target_def)

View source

#check_c_fun(type, value)

View source

#check_main_fun(name, func)

View source

#check_mod_fun(mod, name, func)

View source

#check_proc_is_not_closure(value, type)

View source

#class_var_global_initialized_name(class_var : MetaTypeVar)

View source

#class_var_global_name(class_var : MetaTypeVar)

View source

#clear_current_debug_location

View source

#closured_vars(vars, obj = nil)

View source

#codegen_assign(target, value, node)

View source

#codegen_assign(target : Path, value, node)

View source

#codegen_assign(target : Underscore, value, node)

View source

#codegen_binary_extend_int(t1, t2, p1, p2)

View source

#codegen_binary_op(op, t1 : SymbolType, t2 : SymbolType, p1, p2)

View source

#codegen_binary_op(op, t1 : IntegerType, t2 : IntegerType, p1, p2)

View source

#codegen_binary_op(op, t1 : IntegerType, t2 : FloatType, p1, p2)

View source

#codegen_binary_op(op, t1 : BoolType, t2 : BoolType, p1, p2)

View source

#codegen_binary_op(op, t1 : CharType, t2 : CharType, p1, p2)

View source

#codegen_binary_op(op, t1 : FloatType, t2 : IntegerType, p1, p2)

View source

#codegen_binary_op(op, t1 : FloatType, t2 : FloatType, p1, p2)

View source

#codegen_binary_op(op, t1 : TypeDefType, t2, p1, p2)

View source

#codegen_binary_op(op, t1, t2, p1, p2)

View source

#codegen_binary_op_eq(t1, t2, p1, p2)

View source

#codegen_binary_op_gt(t1, t2, p1, p2)

View source

#codegen_binary_op_gte(t1, t2, p1, p2)

View source

#codegen_binary_op_lt(t1, t2, p1, p2)

View source

#codegen_binary_op_lte(t1, t2, p1, p2)

View source

#codegen_binary_op_ne(t1, t2, p1, p2)

View source

#codegen_binary_op_with_overflow(op, t1, t2, p1, p2)

View source

#codegen_call(node, target_def, self_type, call_args)

View source

#codegen_call_or_invoke(node, target_def, self_type, func, call_args, raises, type, is_closure = false, fun_type = nil)

View source

#codegen_call_with_block(node, block, self_type, call_args)

View source

#codegen_call_with_block_as_fun_literal(node, fun_literal, self_type, call_args)

View source

#codegen_cast(from_type, to_type, arg)

View source

#codegen_cond(node : ASTNode)

View source

#codegen_cond(type)

View source

#codegen_cond_branch(node_cond, then_block, else_block)

View source

#codegen_convert(from_type : FloatType, to_type : FloatType, arg, *, checked : Bool)

View source

#codegen_convert(from_type : IntegerType, to_type : CharType, arg, *, checked : Bool)

View source

#codegen_convert(from_type : CharType, to_type : IntegerType, arg, *, checked : Bool)

View source

#codegen_convert(from_type : SymbolType, to_type : IntegerType, arg, *, checked : Bool)

View source

#codegen_convert(from_type : FloatType, to_type : IntegerType, arg, *, checked : Bool)

View source

#codegen_convert(from_type : IntegerType, to_type : FloatType, arg, *, checked : Bool)

View source

#codegen_convert(from_type, to_type, arg, *, checked : Bool)

View source

#codegen_convert(from_type : IntegerType, to_type : IntegerType, arg, *, checked : Bool)

View source

#codegen_convert(from_type : TypeDefType, to_type, arg, *, checked : Bool)

View source

#codegen_direct_abi_call(call_arg, abi_arg_type)

View source

#codegen_dispatch(node, target_defs)

View source

#codegen_extern_primitive_proc_call(target_def, args, fun_ptr)

View source

#codegen_fun(mangled_name, target_def, self_type, is_exported_fun = false, fun_module_info = type_module(self_type), is_fun_literal = false, is_closure = false)

View source

#codegen_fun_signature(mangled_name, target_def, self_type, is_fun_literal, is_closure)

View source

#codegen_fun_signature_external(mangled_name, target_def)

View source

#codegen_fun_signature_non_external(mangled_name, target_def, self_type, is_fun_literal, is_closure)

View source

#codegen_if_branch(phi, node, branch_block, last)

View source

#codegen_mul_signed_unsigned_with_overflow(t1, t2, p1, p2)

View source

#codegen_mul_unsigned_signed_with_overflow(t1, t2, p1, p2)

View source

#codegen_primitive(call, node, target_def, call_args)

View source

#codegen_primitive_allocate(node, target_def, call_args)

View source

#codegen_primitive_atomicrmw(call, node, target_def, call_args)

View source

#codegen_primitive_binary(node, target_def, call_args)

View source

#codegen_primitive_class(node, target_def, call_args)

View source

#codegen_primitive_class_crystal_instance_type_id(node, target_def, call_args)

View source

#codegen_primitive_class_with_type(type : Type, value)

View source

#codegen_primitive_class_with_type(type : VirtualType, value)

View source

#codegen_primitive_cmpxchg(call, node, target_def, call_args)

View source

#codegen_primitive_convert(node, target_def, call_args, *, checked : Bool)

View source

#codegen_primitive_external_var_get(node, target_def, call_args)

View source

#codegen_primitive_external_var_set(node, target_def, call_args)

View source

#codegen_primitive_fence(call, node, target_def, call_args)

View source

#codegen_primitive_load_atomic(call, node, target_def, call_args)

View source

#codegen_primitive_object_crystal_type_id(node, target_def, call_args)

View source

#codegen_primitive_object_id(node, external, call_args)

View source

#codegen_primitive_pointer_add(node, target_def, call_args)

View source

#codegen_primitive_pointer_address(node, target_def, call_args)

View source

#codegen_primitive_pointer_diff(node, target_def, call_args)

View source

#codegen_primitive_pointer_get(node, target_def, call_args)

View source

#codegen_primitive_pointer_malloc(node, target_def, call_args)

View source

#codegen_primitive_pointer_new(node, target_def, call_args)

View source

#codegen_primitive_pointer_realloc(node, target_def, call_args)

View source

#codegen_primitive_pointer_set(node, target_def, call_args)

View source

#codegen_primitive_proc_call(node, target_def, call_args)

View source

#codegen_primitive_store_atomic(call, node, target_def, call_args)

View source

#codegen_primitive_struct_or_union_set(node, target_def, call_args)

View source

#codegen_primitive_symbol_to_s(node, target_def, call_args)

View source

#codegen_primitive_tuple_indexer_known_index(node, target_def, call_args)

View source

#codegen_re_raise(node, unwind_ex_obj)

View source

#codegen_return(target_def : Def)

View source

#codegen_return(type : Type)

View source

#codegen_return(type : NoReturnType?)

View source

#codegen_return_node(node, node_type)

View source

#codegen_trunc_binary_op_result(t1, t2, result)

Ensures the result is returned in the type of the left hand side operand t1. This is only needed if the operation was carried in the realm of t2 because it was of higher rank

View source

#codegen_tuple_indexer(type, value, index : Int32)

View source

#codegen_tuple_indexer(type, value, index : Range)

View source

#codegen_type_filter

View source

#codegen_va_arg(call, node, target_def, call_args)

View source

#codgen_well_known_functions(node)

View source

#context : Context

View source

#create_check_proc_is_not_closure_fun(fun_name)

View source

#create_debug_type(type : InstanceVarContainer, original_type : Type)

View source

#create_debug_type(type : TupleInstanceType, original_type : Type)

View source

#create_debug_type(type : NamedTupleInstanceType, original_type : Type)

View source

#create_debug_type(type, original_type : Type)

View source

#create_debug_type(type : NonGenericModuleType | GenericClassInstanceMetaclassType | MetaclassType | NilableProcType | VirtualMetaclassType, original_type : Type)

This is a sinkhole for debug types that most likely does not need to be implemented

View source

#create_debug_type(type : TypeDefType, original_type : Type)

View source

#create_debug_type(type : NilableType, original_type : Type)

View source

#create_debug_type(type : NilableReferenceUnionType | ReferenceUnionType, original_type : Type)

View source

#create_debug_type(type : StaticArrayInstanceType, original_type : Type)

View source

#create_debug_type(type : PointerInstanceType, original_type : Type)

View source

#create_debug_type(type : NilType, original_type : Type)

View source

#create_debug_type(type : MixedUnionType, original_type : Type)

View source

#create_debug_type(type : VoidType, original_type : Type)

View source

#create_debug_type(type : CharType, original_type : Type)

View source

#create_debug_type(type : IntegerType, original_type : Type)

View source

#create_debug_type(type : EnumType, original_type : Type)

View source

#create_debug_type(type : BoolType, original_type : Type)

View source

#create_debug_type(type : FloatType, original_type : Type)

View source

#create_debug_type(type : SymbolType, original_type : Type)

View source

#create_initialize_class_var_function(class_var, initializer)

View source

#create_initialize_const_function(fun_name, const)

View source

#create_local_copy_of_arg(target_def, target_def_vars, arg, value, index)

View source

#create_local_copy_of_block_args(target_def, self_type, call_args, args_base_index)

View source

#create_local_copy_of_block_self(self_type, call_args)

View source

#create_local_copy_of_fun_args(target_def, self_type, args, is_fun_literal, is_closure)

View source

#create_metaclass_fun(name)

View source

#create_read_class_var_function(class_var, initializer)

View source

#create_read_const_function(fun_name, const)

View source

#create_read_virtual_class_var_ptr_function(fun_name, class_var, owner)

View source

#create_read_virtual_metaclass_var_ptr_function(fun_name, class_var, owner)

View source

#crystal_malloc_atomic_fun

View source

#crystal_malloc_fun

View source

#crystal_raise_overflow_fun

View source

#crystal_realloc_fun

View source

#data_layout

View source

#debug_codegen_log

Emits a debug message that shows the current llvm basic block name, the location within the codegen that was used to emit this log.

The message is only generated if CRYSTAL_DEBUG_CODEGEN is set

The block given to this method should yield printf arguments to show additional information. The following forms are all valid and helps to allocate the arguments only if the message is to be generated.

debug_codegen_log
debug_codegen_log { }
debug_codegen_log { "Lorem" }
debug_codegen_log { {"Lorem"} }
debug_codegen_log { {"Lorem %d", [an_int_llvm_value] of LLVM::Value} }
View source

#debug_codegen_log(file = __FILE__, line = __LINE__)

Emits a debug message that shows the current llvm basic block name, the location within the codegen that was used to emit this log.

The message is only generated if CRYSTAL_DEBUG_CODEGEN is set

The block given to this method should yield printf arguments to show additional information. The following forms are all valid and helps to allocate the arguments only if the message is to be generated.

debug_codegen_log
debug_codegen_log { }
debug_codegen_log { "Lorem" }
debug_codegen_log { {"Lorem"} }
debug_codegen_log { {"Lorem %d", [an_int_llvm_value] of LLVM::Value} }
View source

#debug_type_cache

View source

#declare_class_var(class_var : MetaTypeVar)

View source

#declare_class_var_and_initialized_flag(class_var : MetaTypeVar)

View source

#declare_class_var_and_initialized_flag_in_this_module(class_var : MetaTypeVar)

View source

#declare_class_var_initialized_flag(class_var : MetaTypeVar)

View source

#declare_const(const)

View source

#declare_const_and_initialized_flag(const)

View source

#declare_const_initialized_flag(const)

View source

#declare_debug_for_function_argument(arg_name, arg_type, arg_no, alloca, location)

View source

#declare_fun(mangled_name, func)

View source

#declare_lib_var(name, type, thread_local)

View source

#declare_parameter(arg_name, arg_type, arg_no, alloca, location)

View source

#declare_var(var)

View source

#declare_variable(var_name, var_type, alloca, location, basic_block : LLVM::BasicBlock? = nil)

View source

#define_main_function(name, arg_types, return_type, needs_alloca = false

View source

#define_symbol_table(llvm_mod, llvm_typer)

View source

#di_builder(llvm_module = @llvm_mod || @main_mod)

View source

#downcast(value, to_type, from_type : VoidType, already_loaded)

View source

#downcast(value, to_type, from_type : Type, already_loaded)

View source

#downcast_distinct(value, to_type : Type, from_type : NilableReferenceUnionType)

View source

#downcast_distinct(value, to_type : NilableType, from_type : MixedUnionType)

View source

#downcast_distinct(value, to_type : BoolType, from_type : MixedUnionType)

View source

#downcast_distinct(value, to_type : Type, from_type : MixedUnionType)

View source

#downcast_distinct(value, to_type : ProcInstanceType, from_type : ProcInstanceType)

View source

#downcast_distinct(value, to_type : TupleInstanceType, from_type : TupleInstanceType)

View source

#downcast_distinct(value, to_type : NamedTupleInstanceType, from_type : NamedTupleInstanceType)

View source

#downcast_distinct(value, to_type : IntegerType, from_type : IntegerType)

This is the case of the automatic cast between integer types

View source

#downcast_distinct(value, to_type : FloatType, from_type : IntegerType)

This is the case of the automatic cast between integer type and float type

View source

#downcast_distinct(value, to_type : FloatType, from_type : FloatType)

This is the case of the automatic cast between float types

View source

#downcast_distinct(value, to_type : EnumType, from_type : SymbolType)

This is the case of the automatic cast between symbol and enum

View source

#downcast_distinct(value, to_type : Type, from_type : Type)

View source

#downcast_distinct(value, to_type : NilableType, from_type : NilableReferenceUnionType)

View source

#downcast_distinct(value, to_type : ReferenceUnionType, from_type : NilableReferenceUnionType)

View source

#downcast_distinct(value, to_type : MixedUnionType, from_type : MixedUnionType)

View source

#downcast_distinct(value, to_type : NilType, from_type : Type)

View source

#downcast_distinct(value, to_type : VirtualType, from_type : VirtualType)

View source

#downcast_distinct(value, to_type : MixedUnionType, from_type : VirtualType)

View source

#downcast_distinct(value, to_type : ReferenceUnionType, from_type : VirtualType)

View source

#downcast_distinct(value, to_type : NonGenericClassType | GenericClassInstanceType, from_type : VirtualType)

View source

#downcast_distinct(value, to_type : VirtualType, from_type : NilableType)

View source

#downcast_distinct(value, to_type : Type, from_type : NilableType)

View source

#downcast_distinct(value, to_type : ProcInstanceType, from_type : NilableProcType)

View source

#downcast_distinct(value, to_type : TypeDefType, from_type : NilableProcType)

View source

#downcast_distinct(value, to_type : PointerInstanceType, from_type : PointerInstanceType)

View source

#downcast_distinct(value, to_type : ReferenceUnionType, from_type : ReferenceUnionType)

View source

#downcast_distinct(value, to_type : VirtualType, from_type : ReferenceUnionType)

View source

#downcast_distinct(value, to_type : Type, from_type : ReferenceUnionType)

View source

#downcast_distinct(value, to_type : VirtualType, from_type : NilableReferenceUnionType)

View source

#downcast_distinct_union_types(value, to_type : MixedUnionType, from_type : MixedUnionType)

View source

#emit_def_debug_metadata(target_def)

View source

#emit_main_def_debug_metadata(main_fun, filename)

View source

#emit_vars_debug_info(vars)

Emit debug info for toplevel variables. Used for the main module and all required files.

View source

#end_visit(node : ReadInstanceVar)

View source

#ensure_class_var_in_this_module(global, class_var)

View source

#ensure_class_var_initialized_flag_in_this_module(initialized_flag, class_var)

View source

#execute_ensures_until(node)

View source

#external_constant(type, name)

View source

#file_and_dir(filename)

View source

#finish

View source

#fun_literal_closure_ptr

View source

#fun_literal_name(node : ProcLiteral)

View source

#fun_metadata_type(debug_types = [] of LibLLVMExt::Metadata)

View source

#fun_metadatas

View source

#generic_array_malloc

View source

#generic_malloc

View source

#get_class_var_global(class_var)

View source

#get_current_debug_scope(location)

View source

#get_debug_type(type, original_type : Type)

View source

#get_debug_type(type)

View source

#get_external_var(external)

View source

#get_global(name, type, real_var, initial_value = nil)

View source

#get_global_var(name, type, real_var, initial_value = nil)

View source

#get_thread_local(name, type, real_var)

View source

#in_alloca_block

View source

#in_main

View source

#initialize_class_var(class_var : MetaTypeVar)

View source

#initialize_class_var(class_var : ClassVar)

View source

#initialize_class_var(class_var : MetaTypeVar, initializer : ClassVarInitializer)

View source

#initialize_const(const)

View source

#initialize_no_init_flag_const(const)

View source

#initialize_predefined_constants

The special constants ARGC_UNSAFE and ARGV_UNSAFE (and others) need to be initialized as soon as the program starts, because we have access to argc and argv in the main function.

View source

#initialize_simple_const(const)

View source

#initialize_simple_constants

Here we only initialize simple constants, those that has simple values like 1, "foo" and other literals.

View source

#inline_call_return_value(target_def, body)

View source

#instance_var_ptr(type, name, pointer)

View source

#last=(last : LLVM::Value)

View source

#lazy_initialize_class_var(node, init_func, global, initialized_flag)

View source

#llvm_context : LLVM::Context

View source

#llvm_self(type = context.type)

View source

#llvm_self_ptr

View source

#llvm_typer : LLVMTyper

View source

#main_fun(name)

View source

#make_fun(type, fun_ptr, ctx_ptr)

View source

#make_nilable_fun(type)

View source

#malloc(type)

View source

#malloc_atomic(type)

View source

#malloc_closure(closure_vars, current_context, parent_context = nil, self_closured = false)

View source

#match_any_type_id(type, type_id)

View source

#match_type_id(type, restriction, type_id)

View source

#memcpy(dest, src, len, align, volatile)

View source

#memset(pointer, value, size)

View source

#metadata(args)

View source

#needs_value_cast_inside_union?(value_type, union_type)

View source

#new_block(name = "")

View source

#new_blocks(*names)

View source

#new_builder(llvm_context)

View source

#new_entry_block

View source

#new_entry_block_chain(*names)

View source

#once_init

View source

#personality_name : String

View source

#prepare_call_args(node, owner)

View source

#prepare_call_args_external(node, target_def, owner)

View source

#prepare_call_args_non_external(node, target_def, owner)

View source

#printf(format, args = [] of LLVM::Value)

View source

#process_finished_hooks

View source

#push_debug_info_metadata(mod)

View source

#read_class_var(node : ClassVar)

View source

#read_class_var(class_var : MetaTypeVar)

View source

#read_class_var_ptr(node : ClassVar)

View source

#read_class_var_ptr(class_var : MetaTypeVar)

View source

#read_const(const)

View source

#read_const_pointer(const)

View source

#read_global(name, type, real_var)

View source

#read_instance_var(node_type, type, name, value)

View source

#read_virtual_class_var_ptr(class_var, owner)

View source

#read_virtual_metaclass_class_var_ptr(class_var, owner)

View source

#realloc(buffer, size)

View source

#request_value(request = true

View source

#reset_nilable_vars(node)

Sets to nil any variable in node that is nilable.

View source

#run_instance_vars_initializers(real_type, type : ClassType | GenericClassInstanceType, type_ptr)

View source

#run_instance_vars_initializers(real_type, type : Type, type_ptr)

View source

#run_instance_vars_initializers_non_recursive(real_type, type, type_ptr)

View source

#run_once(flag, func)

View source

#set_aggregate_field

View source

#set_alignment(inst, type)

View source

#set_call_attributes(node, target_def, self_type, is_closure, fun_type)

This is for function pointer calls and exception handler re-raise

View source

#set_call_attributes(node : Call, target_def, self_type, is_closure, fun_type)

View source

#set_call_attributes_external(node, target_def)

View source

#set_current_debug_location(location)

View source

#set_current_debug_location(node : ASTNode)

View source

#set_ensure_exception_handler(node)

View source

#setup_closure_vars(def_vars, closure_vars, context = self.context, closure_ptr = fun_literal_closure_ptr)

View source

#setup_context_fun(mangled_name, target_def, llvm_args_types, llvm_return_type) : Nil

View source

#sret?(abi_info)

View source

#store_bool_in_union(union_type, union_pointer, value)

View source

#store_in_union(union_type, union_pointer, value_type, value)

View source

#store_nil_in_union(union_pointer, target_type)

View source

#store_void_in_union(union_pointer, target_type)

View source

#struct_field_ptr(type, field_name, pointer)

View source

#sub_image_base(value)

View source

#target_def_fun(target_def, self_type) : LLVM::Function

View source

#to_lhs(value, type)

View source

#to_rhs(value, type)

View source

#try_inline_call(target_def, body, self_type, call_args)

If a method's body is just a simple literal, "self", or an instance variable, we always inline it: less code generated, easier job for LLVM to optimize, and avoid a call in non-release builds.

Do this even in debug mode, because there's not much use in stepping to read a constant value or the value of an instance variable. Additionally, not inlining instance variable getters changes the semantic a program, so we must always inline these.

View source

#type

View source

#type_cast_exception_call(from_type, to_type, node, var_name)

View source

#type_id(value, type)

View source

#type_id(type)

View source

#type_module(type)

View source

#undef_vars(vars, obj)

View source

#union_field_ptr(field_type, pointer)

View source

#union_type_and_value_pointer(union_pointer, type : MixedUnionType)

View source

#union_type_and_value_pointer(union_pointer, type : UnionType)

View source

#union_type_id(union_pointer)

View source

#union_value(union_pointer)

View source

#unreachable(file = __FILE__, line = __LINE__)

View source

#upcast(value, to_type, from_type)

View source

#upcast_distinct(value, to_type : Type, from_type : Type)

View source

#upcast_distinct(value, to_type : GenericClassInstanceType, from_type : Type)

View source

#upcast_distinct(value, to_type : NamedTupleInstanceType, from_type : NamedTupleInstanceType)

View source

#upcast_distinct(value, to_type : VirtualType, from_type)

View source

#upcast_distinct(value, to_type : NilableProcType, from_type : NilType)

View source

#upcast_distinct(value, to_type : NilableType, from_type : Type)

View source

#upcast_distinct(value, to_type : TupleInstanceType, from_type : TupleInstanceType)

View source

#upcast_distinct(value, to_type : EnumType, from_type : Type)

View source

#upcast_distinct(value, to_type : MixedUnionType, from_type : Type)

View source

#upcast_distinct(value, to_type : MixedUnionType, from_type : NilType)

View source

#upcast_distinct(value, to_type : MixedUnionType, from_type : BoolType)

View source

#upcast_distinct(value, to_type : MixedUnionType, from_type : VoidType)

View source

#upcast_distinct(value, to_type : NilableReferenceUnionType, from_type : NilType?)

View source

#upcast_distinct(value, to_type : MixedUnionType, from_type : MixedUnionType)

View source

#upcast_distinct(value, to_type : ReferenceUnionType, from_type)

View source

#upcast_distinct(value, to_type : NilableProcType, from_type : TypeDefType)

View source

#upcast_distinct(value, to_type : NilableReferenceUnionType, from_type : Type)

View source

#upcast_distinct(value, to_type : NilableProcType, from_type : ProcInstanceType)

View source

#upcast_distinct(value, to_type : NilableType, from_type : NilType?)

View source

#upcast_distinct_union_types(value, to_type : MixedUnionType, from_type : MixedUnionType)

View source

#visit(node : Var)

View source

#visit(node : TupleLiteral)

View source

#visit(node : SymbolLiteral)

View source

#visit(node : StringLiteral)

View source

#visit(node : NumberLiteral)

View source

#visit(node : CharLiteral)

View source

#visit(node : BoolLiteral)

View source

#visit(node : NilLiteral)

View source

#visit(node : Nop)

View source

#visit(node : FileNode)

View source

#visit(node : FunDef)

View source

#visit(node : Annotation)

View source

#visit(node : Cast)

View source

#visit(node : NilableCast)

View source

#visit(node : IsA)

View source

#visit(node : RespondsTo)

View source

#visit(node : Def)

View source

#visit(node : Macro)

View source

#visit(node : Path)

View source

#visit(node : Generic)

View source

#visit(node : Yield)

View source

#visit(node : Unreachable)

View source

#visit(node : ExpandableNode)

View source

#visit(node : Call)

View source

#visit(node : Primitive)

Can only happen in a Const or as an argument cast.

View source

#visit(node : Asm)

View source

#visit(node : PointerOf)

View source

#visit(node : TypeDeclaration)

View source

#visit(node : Assign)

View source

#visit(node : Next)

View source

#visit(node : Break)

View source

#visit(node : Not)

View source

#visit(node : While)

View source

#visit(node : If)

View source

#visit(node : Extend)

View source

#visit(node : Include)

View source

#visit(node : InstanceSizeOf)

View source

#visit(node : SizeOf)

View source

#visit(node : TypeOf)

View source

#visit(node : Alias)

View source

#visit(node : Global)

View source

#visit(node : ProcLiteral)

View source

#visit(node : ProcPointer)

View source

#visit(node : Expressions)

View source

#visit(node : Return)

View source

#visit(node : ClassDef)

View source

#visit(node : ModuleDef)

View source

#visit(node : LibDef)

View source

#visit(node : EnumDef)

View source

#visit(node : ExternalVar)

View source

#visit(node : InstanceVar)

View source

#visit(node : ClassVar)

View source

#visit(node : TypeDef)

View source

#visit(node : ASTNode)

View source

#visit_any(node)

View source

#void_ptr_throwinfo

View source

#void_ptr_type_descriptor

View source

#with_cloned_context

View source

#with_context

View source

#wrap_builder(builder)

View source