Skip to content

Commit

Permalink
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/compiler/crystal/codegen/debug.cr
Original file line number Diff line number Diff line change
@@ -38,8 +38,14 @@ module Crystal
di_builder.create_subroutine_type(nil, int1)
end

def debug_type_cache
@debug_types ||= {} of Type => LibLLVMExt::Metadata?
def debug_type_cache(llvm_module = @llvm_mod)
# We must cache debug types per module so metadata of a type
# from one module isn't incorrectly used in another module.
debug_types_per_module =
@debug_types_per_module ||=
{} of LLVM::Module => Hash(Type, LibLLVMExt::Metadata?)

debug_types_per_module[llvm_module] ||= {} of Type => LibLLVMExt::Metadata?
end

def get_debug_type(type)

0 comments on commit b5484e4

Please sign in to comment.