@@ -168,35 +168,35 @@ fn forward_declared_constant_is_also_marked_constant() {
168
168
%foo = type { i16 }
169
169
%mainProg = type { i16 }
170
170
171
- @__foo__init = external unnamed_addr constant %foo, !dbg !0
172
- @mainProg_instance = external global %mainProg, !dbg !8
171
+ @__foo__init = external unnamed_addr constant %foo
172
+ @mainProg_instance = external global %mainProg
173
173
174
- define i16 @main() !dbg !18 {
174
+ define i16 @main() !dbg !4 {
175
175
entry:
176
176
%main = alloca i16, align 2
177
177
%f = alloca %foo, align 8
178
- call void @llvm.dbg.declare(metadata %foo* %f, metadata !23 , metadata !DIExpression()), !dbg !24
178
+ call void @llvm.dbg.declare(metadata %foo* %f, metadata !9 , metadata !DIExpression()), !dbg !15
179
179
%0 = bitcast %foo* %f to i8*
180
180
call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 1 %0, i8* align 1 bitcast (%foo* @__foo__init to i8*), i64 ptrtoint (%foo* getelementptr (%foo, %foo* null, i32 1) to i64), i1 false)
181
- call void @llvm.dbg.declare(metadata i16* %main, metadata !25 , metadata !DIExpression()), !dbg !26
181
+ call void @llvm.dbg.declare(metadata i16* %main, metadata !16 , metadata !DIExpression()), !dbg !17
182
182
store i16 0, i16* %main, align 2
183
- call void @__init_foo(%foo* %f), !dbg !27
184
- call void @__user_init_foo(%foo* %f), !dbg !27
185
- %something_to_initialize = getelementptr inbounds %foo, %foo* %f, i32 0, i32 0, !dbg !27
186
- %load_something_to_initialize = load i16, i16* %something_to_initialize, align 2, !dbg !27
187
- store i16 %load_something_to_initialize, i16* getelementptr inbounds (%mainProg, %mainProg* @mainProg_instance, i32 0, i32 0), align 2, !dbg !27
188
- call void @mainProg(%mainProg* @mainProg_instance), !dbg !28
189
- %main_ret = load i16, i16* %main, align 2, !dbg !29
190
- ret i16 %main_ret, !dbg !29
183
+ call void @__init_foo(%foo* %f), !dbg !18
184
+ call void @__user_init_foo(%foo* %f), !dbg !18
185
+ %something_to_initialize = getelementptr inbounds %foo, %foo* %f, i32 0, i32 0, !dbg !18
186
+ %load_something_to_initialize = load i16, i16* %something_to_initialize, align 2, !dbg !18
187
+ store i16 %load_something_to_initialize, i16* getelementptr inbounds (%mainProg, %mainProg* @mainProg_instance, i32 0, i32 0), align 2, !dbg !18
188
+ call void @mainProg(%mainProg* @mainProg_instance), !dbg !19
189
+ %main_ret = load i16, i16* %main, align 2, !dbg !20
190
+ ret i16 %main_ret, !dbg !20
191
191
}
192
192
193
- declare !dbg !30 void @foo(%foo*)
193
+ declare !dbg !21 void @foo(%foo*)
194
194
195
195
declare void @__init_foo(%foo*)
196
196
197
- declare !dbg !33 void @__user_init_foo(%foo*)
197
+ declare !dbg !24 void @__user_init_foo(%foo*)
198
198
199
- declare !dbg !38 void @mainProg(%mainProg*)
199
+ declare !dbg !29 void @mainProg(%mainProg*)
200
200
201
201
; Function Attrs: nofree nosync nounwind readnone speculatable willreturn
202
202
declare void @llvm.dbg.declare(metadata, metadata, metadata) #0
@@ -207,50 +207,44 @@ fn forward_declared_constant_is_also_marked_constant() {
207
207
attributes #0 = { nofree nosync nounwind readnone speculatable willreturn }
208
208
attributes #1 = { argmemonly nofree nounwind willreturn }
209
209
210
- !llvm.module.flags = !{!13, !14}
211
- !llvm.dbg.cu = !{!15}
212
-
213
- !0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression())
214
- !1 = distinct !DIGlobalVariable(name: "__foo__init", scope: !2, file: !2, line: 12, type: !3, isLocal: false, isDefinition: true)
215
- !2 = !DIFile(filename: "external_file2.st", directory: "")
216
- !3 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !4)
217
- !4 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", scope: !2, file: !2, line: 12, size: 16, align: 64, flags: DIFlagPublic, elements: !5, identifier: "foo")
218
- !5 = !{!6}
219
- !6 = !DIDerivedType(tag: DW_TAG_member, name: "something_to_initialize", scope: !2, file: !2, line: 14, baseType: !7, size: 16, align: 16, flags: DIFlagPublic)
220
- !7 = !DIBasicType(name: "INT", size: 16, encoding: DW_ATE_signed, flags: DIFlagPublic)
221
- !8 = !DIGlobalVariableExpression(var: !9, expr: !DIExpression())
222
- !9 = distinct !DIGlobalVariable(name: "mainProg", scope: !2, file: !2, line: 6, type: !10, isLocal: false, isDefinition: true)
223
- !10 = !DICompositeType(tag: DW_TAG_structure_type, name: "mainProg", scope: !2, file: !2, line: 6, size: 16, align: 64, flags: DIFlagPublic, elements: !11, identifier: "mainProg")
224
- !11 = !{!12}
225
- !12 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !2, file: !2, line: 8, baseType: !7, size: 16, align: 16, flags: DIFlagPublic)
226
- !13 = !{i32 2, !"Dwarf Version", i32 5}
227
- !14 = !{i32 2, !"Debug Info Version", i32 3}
228
- !15 = distinct !DICompileUnit(language: DW_LANG_C, file: !16, producer: "RuSTy Structured text Compiler", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, globals: !17, splitDebugInlining: false)
229
- !16 = !DIFile(filename: "external_file1.st", directory: "root")
230
- !17 = !{!0, !8}
231
- !18 = distinct !DISubprogram(name: "main", linkageName: "main", scope: !19, file: !19, line: 2, type: !20, scopeLine: 2, flags: DIFlagPublic, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !22)
232
- !19 = !DIFile(filename: "external_file1.st", directory: "")
233
- !20 = !DISubroutineType(flags: DIFlagPublic, types: !21)
234
- !21 = !{null}
235
- !22 = !{}
236
- !23 = !DILocalVariable(name: "f", scope: !18, file: !19, line: 4, type: !4, align: 64)
237
- !24 = !DILocation(line: 4, column: 8, scope: !18)
238
- !25 = !DILocalVariable(name: "main", scope: !18, file: !19, line: 2, type: !7, align: 16)
239
- !26 = !DILocation(line: 2, column: 13, scope: !18)
240
- !27 = !DILocation(line: 0, scope: !18)
241
- !28 = !DILocation(line: 6, column: 8, scope: !18)
242
- !29 = !DILocation(line: 7, column: 4, scope: !18)
243
- !30 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: !2, file: !2, line: 12, type: !31, scopeLine: 16, flags: DIFlagPublic, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !22)
244
- !31 = !DISubroutineType(flags: DIFlagPublic, types: !32)
245
- !32 = !{null, !4}
246
- !33 = distinct !DISubprogram(name: "__user_init_foo", linkageName: "__user_init_foo", scope: !34, file: !34, type: !35, scopeLine: 1, flags: DIFlagPublic, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !22)
247
- !34 = !DIFile(filename: "__initializers", directory: "")
248
- !35 = !DISubroutineType(flags: DIFlagPublic, types: !36)
249
- !36 = !{null, !37}
250
- !37 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "__auto_pointer_to_foo", baseType: !4, size: 64, align: 64, dwarfAddressSpace: 1)
251
- !38 = distinct !DISubprogram(name: "mainProg", linkageName: "mainProg", scope: !2, file: !2, line: 6, type: !39, scopeLine: 10, flags: DIFlagPublic, spFlags: DISPFlagDefinition, unit: !15, retainedNodes: !22)
252
- !39 = !DISubroutineType(flags: DIFlagPublic, types: !40)
253
- !40 = !{null, !10, !7}
210
+ !llvm.module.flags = !{!0, !1}
211
+ !llvm.dbg.cu = !{!2}
212
+
213
+ !0 = !{i32 2, !"Dwarf Version", i32 5}
214
+ !1 = !{i32 2, !"Debug Info Version", i32 3}
215
+ !2 = distinct !DICompileUnit(language: DW_LANG_C, file: !3, producer: "RuSTy Structured text Compiler", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false)
216
+ !3 = !DIFile(filename: "external_file1.st", directory: "root")
217
+ !4 = distinct !DISubprogram(name: "main", linkageName: "main", scope: !5, file: !5, line: 2, type: !6, scopeLine: 2, flags: DIFlagPublic, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !8)
218
+ !5 = !DIFile(filename: "external_file1.st", directory: "")
219
+ !6 = !DISubroutineType(flags: DIFlagPublic, types: !7)
220
+ !7 = !{null}
221
+ !8 = !{}
222
+ !9 = !DILocalVariable(name: "f", scope: !4, file: !5, line: 4, type: !10, align: 64)
223
+ !10 = !DICompositeType(tag: DW_TAG_structure_type, name: "foo", scope: !11, file: !11, line: 12, size: 16, align: 64, flags: DIFlagPublic, elements: !12, identifier: "foo")
224
+ !11 = !DIFile(filename: "external_file2.st", directory: "")
225
+ !12 = !{!13}
226
+ !13 = !DIDerivedType(tag: DW_TAG_member, name: "something_to_initialize", scope: !11, file: !11, line: 14, baseType: !14, size: 16, align: 16, flags: DIFlagPublic)
227
+ !14 = !DIBasicType(name: "INT", size: 16, encoding: DW_ATE_signed, flags: DIFlagPublic)
228
+ !15 = !DILocation(line: 4, column: 8, scope: !4)
229
+ !16 = !DILocalVariable(name: "main", scope: !4, file: !5, line: 2, type: !14, align: 16)
230
+ !17 = !DILocation(line: 2, column: 13, scope: !4)
231
+ !18 = !DILocation(line: 0, scope: !4)
232
+ !19 = !DILocation(line: 6, column: 8, scope: !4)
233
+ !20 = !DILocation(line: 7, column: 4, scope: !4)
234
+ !21 = distinct !DISubprogram(name: "foo", linkageName: "foo", scope: !11, file: !11, line: 12, type: !22, scopeLine: 16, flags: DIFlagPublic, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !8)
235
+ !22 = !DISubroutineType(flags: DIFlagPublic, types: !23)
236
+ !23 = !{null, !10}
237
+ !24 = distinct !DISubprogram(name: "__user_init_foo", linkageName: "__user_init_foo", scope: !25, file: !25, type: !26, scopeLine: 1, flags: DIFlagPublic, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !8)
238
+ !25 = !DIFile(filename: "__initializers", directory: "")
239
+ !26 = !DISubroutineType(flags: DIFlagPublic, types: !27)
240
+ !27 = !{null, !28}
241
+ !28 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "__auto_pointer_to_foo", baseType: !10, size: 64, align: 64, dwarfAddressSpace: 1)
242
+ !29 = distinct !DISubprogram(name: "mainProg", linkageName: "mainProg", scope: !11, file: !11, line: 6, type: !30, scopeLine: 10, flags: DIFlagPublic, spFlags: DISPFlagDefinition, unit: !2, retainedNodes: !8)
243
+ !30 = !DISubroutineType(flags: DIFlagPublic, types: !31)
244
+ !31 = !{null, !32, !14}
245
+ !32 = !DICompositeType(tag: DW_TAG_structure_type, name: "mainProg", scope: !11, file: !11, line: 6, size: 16, align: 64, flags: DIFlagPublic, elements: !33, identifier: "mainProg")
246
+ !33 = !{!34}
247
+ !34 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !11, file: !11, line: 8, baseType: !14, size: 16, align: 16, flags: DIFlagPublic)
254
248
255
249
; ModuleID = 'external_file2.st'
256
250
source_filename = "external_file2.st"
0 commit comments