llvm.org GIT mirror llvm / 50d80e3
Do not include types without any definition in pubtypes list. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@101171 91177308-0d34-0410-b5e6-96231b3b80d8 Devang Patel 10 years ago
2 changed file(s) with 52 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
16111611 if (!ATy.isValid())
16121612 continue;
16131613 DICompositeType CATy = getDICompositeType(ATy);
1614 if (DIDescriptor(CATy.getNode()).Verify() && !CATy.getName().empty()) {
1614 if (DIDescriptor(CATy.getNode()).Verify() && !CATy.getName().empty()
1615 && !CATy.isForwardDecl()) {
16151616 if (DIEEntry *Entry = ModuleCU->getDIEEntry(CATy.getNode()))
16161617 ModuleCU->addGlobalType(CATy.getName(), Entry->getEntry());
16171618 }
18031804 ModuleCU->addGlobal(DI_GV.getName(), VariableDie);
18041805
18051806 DIType GTy = DI_GV.getType();
1806 if (GTy.isCompositeType() && !GTy.getName().empty()) {
1807 if (GTy.isCompositeType() && !GTy.getName().empty()
1808 && !GTy.isForwardDecl()) {
18071809 DIEEntry *Entry = ModuleCU->getDIEEntry(GTy.getNode());
18081810 assert(Entry && "Missing global type!");
18091811 ModuleCU->addGlobalType(GTy.getName(), Entry->getEntry());
0 ; RUN: llc -O0 -asm-verbose < %s > %t
1 ; RUN: grep "External Name" %t | grep -v X
2 ; RUN: grep "External Name" %t | grep Y | count 1
3 ; Test to check type with no defintion is listed in pubtypes section.
4
5 %struct.X = type opaque
6 %struct.Y = type { i32 }
7
8 define i32 @foo(%struct.X* %x, %struct.Y* %y) nounwind ssp {
9 entry:
10 %x_addr = alloca %struct.X* ; <%struct.X**> [#uses=1]
11 %y_addr = alloca %struct.Y* ; <%struct.Y**> [#uses=1]
12 %retval = alloca i32 ; [#uses=2]
13 %0 = alloca i32 ; [#uses=2]
14 %"alloca point" = bitcast i32 0 to i32 ; [#uses=0]
15 call void @llvm.dbg.declare(metadata !{%struct.X** %x_addr}, metadata !0), !dbg !13
16 store %struct.X* %x, %struct.X** %x_addr
17 call void @llvm.dbg.declare(metadata !{%struct.Y** %y_addr}, metadata !14), !dbg !13
18 store %struct.Y* %y, %struct.Y** %y_addr
19 store i32 0, i32* %0, align 4, !dbg !13
20 %1 = load i32* %0, align 4, !dbg !13 ; [#uses=1]
21 store i32 %1, i32* %retval, align 4, !dbg !13
22 br label %return, !dbg !13
23
24 return: ; preds = %entry
25 %retval1 = load i32* %retval, !dbg !13 ; [#uses=1]
26 ret i32 %retval1, !dbg !15
27 }
28
29 declare void @llvm.dbg.declare(metadata, metadata) nounwind readnone
30
31 !0 = metadata !{i32 524545, metadata !1, metadata !"x", metadata !2, i32 7, metadata !7} ; [ DW_TAG_arg_variable ]
32 !1 = metadata !{i32 524334, i32 0, metadata !2, metadata !"foo", metadata !"foo", metadata !"foo", metadata !2, i32 7, metadata !4, i1 false, i1 true, i32 0, i32 0, null, i1 false} ; [ DW_TAG_subprogram ]
33 !2 = metadata !{i32 524329, metadata !"a.c", metadata !"/tmp/", metadata !3} ; [ DW_TAG_file_type ]
34 !3 = metadata !{i32 524305, i32 0, i32 1, metadata !"a.c", metadata !"/tmp/", metadata !"4.2.1 (Based on Apple Inc. build 5658) (LLVM build)", i1 true, i1 false, metadata !"", i32 0} ; [ DW_TAG_compile_unit ]
35 !4 = metadata !{i32 524309, metadata !2, metadata !"", metadata !2, i32 0, i64 0, i64 0, i64 0, i32 0, null, metadata !5, i32 0, null} ; [ DW_TAG_subroutine_type ]
36 !5 = metadata !{metadata !6, metadata !7, metadata !9}
37 !6 = metadata !{i32 524324, metadata !2, metadata !"int", metadata !2, i32 0, i64 32, i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ]
38 !7 = metadata !{i32 524303, metadata !2, metadata !"", metadata !2, i32 0, i64 64, i64 64, i64 0, i32 0, metadata !8} ; [ DW_TAG_pointer_type ]
39 !8 = metadata !{i32 524307, metadata !2, metadata !"X", metadata !2, i32 3, i64 0, i64 0, i64 0, i32 4, null, null, i32 0, null} ; [ DW_TAG_structure_type ]
40 !9 = metadata !{i32 524303, metadata !2, metadata !"", metadata !2, i32 0, i64 64, i64 64, i64 0, i32 0, metadata !10} ; [ DW_TAG_pointer_type ]
41 !10 = metadata !{i32 524307, metadata !2, metadata !"Y", metadata !2, i32 4, i64 32, i64 32, i64 0, i32 0, null, metadata !11, i32 0, null} ; [ DW_TAG_structure_type ]
42 !11 = metadata !{metadata !12}
43 !12 = metadata !{i32 524301, metadata !10, metadata !"x", metadata !2, i32 5, i64 32, i64 32, i64 0, i32 0, metadata !6} ; [ DW_TAG_member ]
44 !13 = metadata !{i32 7, i32 0, metadata !1, null}
45 !14 = metadata !{i32 524545, metadata !1, metadata !"y", metadata !2, i32 7, metadata !9} ; [ DW_TAG_arg_variable ]
46 !15 = metadata !{i32 7, i32 0, metadata !16, null}
47 !16 = metadata !{i32 524299, metadata !1, i32 7, i32 0} ; [ DW_TAG_lexical_block ]