File tree 1 file changed +8
-4
lines changed
src/compiler/crystal/codegen
1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -46,12 +46,16 @@ class Crystal::CodeGenVisitor
46
46
@main_mod .globals.add(@main_llvm_typer .llvm_type(const.value.type), global_name)
47
47
48
48
type = const.value.type
49
- # TODO: there's an LLVM bug that prevents us from having internal globals of type i128 or u128:
49
+ # TODO: LLVM < 9.0.0 has a bug that prevents us from having internal globals of type i128 or u128:
50
50
# https://bugs.llvm.org/show_bug.cgi?id=42932
51
- # so we just use global.
52
- if @single_module && ! (type .is_a?(IntegerType ) && (type .kind.i128? || type .kind.u128?))
51
+ # so we just use global in that case.
52
+ {% if compare_versions(Crystal ::LLVM_VERSION , " 9.0.0" ) < 0 % }
53
+ if @single_module && ! (type .is_a?(IntegerType ) && (type .kind.i128? || type .kind.u128?))
54
+ global.linkage = LLVM ::Linkage ::Internal
55
+ end
56
+ {% else % }
53
57
global.linkage = LLVM ::Linkage ::Internal if @single_module
54
- end
58
+ { % end % }
55
59
56
60
global
57
61
end
You can’t perform that action at this time.
0 commit comments