Skip to content

Commit 20be769

Browse files
committed
Upgrade to LLVM 19:
While I am no longer actively maintaining this project, I saw LLVM recently upgraded, and so I figured it might be nice to see what changes have been made, and how they might affect this project. While Skull uses very little of what LLVM has to offer, it is nice to know when some of the core functionality changes.
1 parent 9e01740 commit 20be769

File tree

5 files changed

+17
-22
lines changed

5 files changed

+17
-22
lines changed

skull/codegen/llvm/debug.c

+2-2
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ static void add_llvm_local_var_def_debug_info(
279279
8 // alignment
280280
);
281281

282-
LLVMDIBuilderInsertDeclareAtEnd(
282+
LLVMDIBuilderInsertDeclareRecordAtEnd(
283283
DEBUG_INFO.builder,
284284
symbol->var->ref,
285285
di_var,
@@ -372,7 +372,7 @@ LLVMMetadataRef add_llvm_func_debug_info(
372372

373373
alloc_debug_function_param(func->params[i]->symbol->var, state);
374374

375-
LLVMDIBuilderInsertDeclareAtEnd(
375+
LLVMDIBuilderInsertDeclareRecordAtEnd(
376376
DEBUG_INFO.builder,
377377
func->params[i]->symbol->var->ref,
378378
di_var,

test/sh/skull/o1.sk.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
source_filename = "./test/sh/skull/o1.sk"
33

44
; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(none)
5-
define i64 @.o1() local_unnamed_addr #0 {
5+
define noundef i64 @.o1() local_unnamed_addr #0 {
66
entry:
77
ret i64 1
88
}

test/skull/codegen/llvm/_first.sk.ll

+12-17
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,20 @@ define private void @f2(i64 %0) !dbg !17 {
1919
entry:
2020
%x = alloca i64, align 8
2121
store i64 %0, ptr %x, align 4
22-
call void @llvm.dbg.declare(metadata ptr %x, metadata !21, metadata !DIExpression()), !dbg !22
22+
#dbg_declare(ptr %x, !21, !DIExpression(), !22)
2323
%noop = alloca i64, align 8
2424
store i64 0, ptr %noop, align 4, !dbg !23
2525
ret void
2626
}
2727

28-
; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
29-
declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
30-
3128
define private void @f3(i64 %0, i64 %1) !dbg !24 {
3229
entry:
3330
%y = alloca i64, align 8
3431
store i64 %0, ptr %y, align 4
35-
call void @llvm.dbg.declare(metadata ptr %y, metadata !28, metadata !DIExpression()), !dbg !30
32+
#dbg_declare(ptr %y, !28, !DIExpression(), !30)
3633
%z = alloca i64, align 8
3734
store i64 %1, ptr %z, align 4
38-
call void @llvm.dbg.declare(metadata ptr %z, metadata !29, metadata !DIExpression()), !dbg !30
35+
#dbg_declare(ptr %z, !29, !DIExpression(), !30)
3936
%noop = alloca i64, align 8
4037
store i64 0, ptr %noop, align 4, !dbg !31
4138
ret void
@@ -45,31 +42,31 @@ define private void @f4() !dbg !32 {
4542
entry:
4643
%local_var = alloca i64, align 8
4744
store i64 1, ptr %local_var, align 4, !dbg !49
48-
call void @llvm.dbg.declare(metadata ptr %local_var, metadata !36, metadata !DIExpression()), !dbg !49
45+
#dbg_declare(ptr %local_var, !36, !DIExpression(), !49)
4946
br i1 true, label %if_true, label %end
5047

5148
if_true: ; preds = %entry
5249
%if_test = alloca i64, align 8
5350
store i64 1, ptr %if_test, align 4, !dbg !50
54-
call void @llvm.dbg.declare(metadata ptr %if_test, metadata !37, metadata !DIExpression()), !dbg !50
51+
#dbg_declare(ptr %if_test, !37, !DIExpression(), !50)
5552
br label %end
5653

5754
end: ; preds = %entry, %if_true
5855
%int = alloca i64, align 8
5956
store i64 1234, ptr %int, align 4, !dbg !51
60-
call void @llvm.dbg.declare(metadata ptr %int, metadata !39, metadata !DIExpression()), !dbg !51
57+
#dbg_declare(ptr %int, !39, !DIExpression(), !51)
6158
%float = alloca double, align 8
6259
store double 3.141500e+00, ptr %float, align 8, !dbg !52
63-
call void @llvm.dbg.declare(metadata ptr %float, metadata !40, metadata !DIExpression()), !dbg !52
60+
#dbg_declare(ptr %float, !40, !DIExpression(), !52)
6461
%rune = alloca i32, align 4
6562
store i32 120, ptr %rune, align 4, !dbg !53
66-
call void @llvm.dbg.declare(metadata ptr %rune, metadata !42, metadata !DIExpression()), !dbg !53
63+
#dbg_declare(ptr %rune, !42, !DIExpression(), !53)
6764
%bool = alloca i1, align 1
6865
store i1 false, ptr %bool, align 1, !dbg !54
69-
call void @llvm.dbg.declare(metadata ptr %bool, metadata !44, metadata !DIExpression()), !dbg !54
66+
#dbg_declare(ptr %bool, !44, !DIExpression(), !54)
7067
%str = alloca ptr, align 8
7168
store ptr @0, ptr %str, align 8, !dbg !55
72-
call void @llvm.dbg.declare(metadata ptr %str, metadata !46, metadata !DIExpression()), !dbg !55
69+
#dbg_declare(ptr %str, !46, !DIExpression(), !55)
7370
%0 = load i1, ptr %bool, align 1, !dbg !56
7471
br i1 %0, label %if_true2, label %end1
7572

@@ -82,8 +79,6 @@ end1: ; preds = %end, %if_true2
8279
ret void, !dbg !59
8380
}
8481

85-
attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
86-
8782
!llvm.dbg.cu = !{!2}
8883
!llvm.module.flags = !{!6, !7}
8984

@@ -95,12 +90,12 @@ attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memo
9590
!5 = !DIBasicType(name: "Int", size: 64, encoding: DW_ATE_signed)
9691
!6 = !{i32 4, !"Dwarf Version", i32 4}
9792
!7 = !{i32 4, !"Debug Info Version", i32 3}
98-
!8 = distinct !DISubprogram(name: ".first", scope: !3, file: !3, line: 1, type: !9, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !10)
93+
!8 = distinct !DISubprogram(name: ".first", scope: !3, file: !3, line: 1, type: !9, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !2)
9994
!9 = !DISubroutineType(types: !10)
10095
!10 = !{}
10196
!11 = !DILocation(line: 5, column: 1, scope: !8)
10297
!12 = !DILocation(line: 1, column: 1, scope: !8)
103-
!13 = distinct !DISubprogram(name: "f", scope: !3, file: !3, line: 1, type: !14, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !10)
98+
!13 = distinct !DISubprogram(name: "f", scope: !3, file: !3, line: 1, type: !14, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !2)
10499
!14 = !DISubroutineType(types: !15)
105100
!15 = !{!5}
106101
!16 = !DILocation(line: 2, column: 2, scope: !13)

test/skull/codegen/llvm/_ptr_types.sk.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ entry:
6161
!36 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "&&Int", baseType: !24, size: 64, dwarfAddressSpace: 0)
6262
!37 = !{i32 4, !"Dwarf Version", i32 4}
6363
!38 = !{i32 4, !"Debug Info Version", i32 3}
64-
!39 = distinct !DISubprogram(name: ".ptr_types", scope: !3, file: !3, line: 1, type: !40, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !41)
64+
!39 = distinct !DISubprogram(name: ".ptr_types", scope: !3, file: !3, line: 1, type: !40, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !2)
6565
!40 = !DISubroutineType(types: !41)
6666
!41 = !{}
6767
!42 = !DILocation(line: 1, column: 1, scope: !39)

test/skull/codegen/llvm/_return.sk.ll

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ entry:
1313
!1 = !DIFile(filename: "./test/skull/codegen/llvm/return.sk", directory: ".")
1414
!2 = !{i32 4, !"Dwarf Version", i32 4}
1515
!3 = !{i32 4, !"Debug Info Version", i32 3}
16-
!4 = distinct !DISubprogram(name: ".return", scope: !1, file: !1, line: 1, type: !5, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !6)
16+
!4 = distinct !DISubprogram(name: ".return", scope: !1, file: !1, line: 1, type: !5, scopeLine: 1, spFlags: DISPFlagDefinition, unit: !0)
1717
!5 = !DISubroutineType(types: !6)
1818
!6 = !{}
1919
!7 = !DILocation(line: 1, column: 1, scope: !4)

0 commit comments

Comments
 (0)