mun_codegen 0.4.0

LLVM IR code generation for Mun
---
source: crates/mun_codegen/src/test.rs
expression: "\n    //- /mod.mun\n    pub fn main() -> i32 {\n        foo::get_value()\n    }\n\n    //- /foo.mun\n    pub(super) fn get_value() -> i32 {\n        3\n    }\n    "
---
; == FILE IR (mod) =====================================
; ModuleID = 'mod'
source_filename = "mod"

%DispatchTable = type { i32 ()* }

@dispatchTable = external global %DispatchTable
@global_type_lookup_table = external global [1 x i64*]

define i32 @main() {
body:
  %get_value_ptr = load i32 ()*, i32 ()** getelementptr inbounds (%DispatchTable, %DispatchTable* @dispatchTable, i32 0, i32 0), align 8
  %get_value = call i32 %get_value_ptr()
  ret i32 %get_value
}

; == GROUP IR (mod) ====================================
; ModuleID = 'group_name'
source_filename = "group_name"

%DispatchTable = type { i32 ()* }

@dispatchTable = global %DispatchTable zeroinitializer
@global_type_lookup_table = global [1 x i64*] zeroinitializer

; == FILE IR (foo) =====================================
; ModuleID = 'foo'
source_filename = "foo"

@global_type_lookup_table = external global [1 x i64*]

define i32 @get_value() {
body:
  ret i32 3
}

; == GROUP IR (foo) ====================================
; ModuleID = 'group_name'
source_filename = "group_name"

@global_type_lookup_table = global [1 x i64*] zeroinitializer