aboutsummaryrefslogtreecommitdiffstats
path: root/test/DebugInfo/AArch64/frameindices.ll
blob: 71ca4b81169cebb9ee285fb1dbe9c5b113c9926d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
; RUN: llc -O0 -filetype=obj < %s | llvm-dwarfdump - | FileCheck %s
; Test that a variable with multiple entries in the MMI table makes it into the
; debug info.
;
; CHECK: DW_TAG_inlined_subroutine
; CHECK:    "_Z3f111A"
; CHECK: DW_TAG_formal_parameter
; CHECK: DW_AT_location [DW_FORM_block1]    (<0x0b> 91 51 9d 78 08 91 4a 9d 38 88 01 )
;  -- fbreg -47, bit-piece 120 8 , fbreg -54, bit-piece 56 136 ------^
; CHECK: DW_AT_abstract_origin {{.*}} "p1"
;
; long a;
; struct A {
;   bool x4;
;   void *x5;
;   bool x6;
; };
; int *b;
; struct B {
;   B(long);
;   ~B();
; };
; void f9(A);
; void f13(A p1) {
;   b = (int *)__builtin_operator_new(a);
;   f9(p1);
; }
; void f11(A p1) { f13(p1); }
; void f16() {
;   A c;
;   B d(a);
;   c.x6 = c.x4 = true;
;   f11(c);
; }
; ModuleID = 'test.cpp'
target datalayout = "e-m:o-i64:64-i128:128-n32:64-S128"
target triple = "aarch64-apple-ios"

%struct.A = type { i8, i8*, i8 }
%struct.B = type { i8 }

@a = global i64 0, align 8
@b = global i32* null, align 8

define void @_Z3f131A(%struct.A* nocapture readonly %p1) #0 {
entry:
  %agg.tmp = alloca %struct.A, align 8
  tail call void @llvm.dbg.declare(metadata %struct.A* %p1, metadata !30, metadata !46), !dbg !47
  %0 = load i64, i64* @a, align 8, !dbg !48, !tbaa !49
  %call = tail call noalias i8* @_Znwm(i64 %0) #5, !dbg !53
  store i8* %call, i8** bitcast (i32** @b to i8**), align 8, !dbg !54, !tbaa !55
  %1 = getelementptr inbounds %struct.A, %struct.A* %agg.tmp, i64 0, i32 0, !dbg !57
  %2 = getelementptr inbounds %struct.A, %struct.A* %p1, i64 0, i32 0, !dbg !57
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %2, i64 24, i32 8, i1 false), !dbg !57, !tbaa.struct !58
  call void @_Z2f91A(%struct.A* %agg.tmp), !dbg !61
  ret void, !dbg !62
}

; Function Attrs: nounwind readnone
declare void @llvm.dbg.declare(metadata, metadata, metadata) #1

; Function Attrs: nobuiltin
declare noalias i8* @_Znwm(i64) #2

declare void @_Z2f91A(%struct.A*) #0

; Function Attrs: nounwind
declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture, i8* nocapture readonly, i64, i32, i1) #3

define void @_Z3f111A(%struct.A* nocapture readonly %p1) #0 {
entry:
  %agg.tmp.i = alloca %struct.A, align 8
  tail call void @llvm.dbg.declare(metadata %struct.A* %p1, metadata !33, metadata !46), !dbg !63
  %0 = getelementptr inbounds %struct.A, %struct.A* %p1, i64 0, i32 0, !dbg !64
  %1 = getelementptr inbounds %struct.A, %struct.A* %agg.tmp.i, i64 0, i32 0, !dbg !65
  call void @llvm.lifetime.start(i64 24, i8* %1), !dbg !65
  %2 = load i64, i64* @a, align 8, !dbg !67, !tbaa !49
  %call.i = tail call noalias i8* @_Znwm(i64 %2) #5, !dbg !68
  store i8* %call.i, i8** bitcast (i32** @b to i8**), align 8, !dbg !69, !tbaa !55
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %1, i8* %0, i64 24, i32 8, i1 false), !dbg !70
  call void @_Z2f91A(%struct.A* %agg.tmp.i), !dbg !71
  call void @llvm.lifetime.end(i64 24, i8* %1), !dbg !72
  ret void, !dbg !73
}

define void @_Z3f16v() #0 {
entry:
  %agg.tmp.i.i = alloca %struct.A, align 8
  %d = alloca %struct.B, align 1
  %agg.tmp.sroa.2 = alloca [15 x i8], align 1
  %agg.tmp.sroa.4 = alloca [7 x i8], align 1
  tail call void @llvm.dbg.declare(metadata [15 x i8]* %agg.tmp.sroa.2, metadata !74, metadata !76), !dbg !77
  tail call void @llvm.dbg.declare(metadata [7 x i8]* %agg.tmp.sroa.4, metadata !74, metadata !78), !dbg !77
  tail call void @llvm.dbg.declare(metadata %struct.A* undef, metadata !38, metadata !79), !dbg !80
  %0 = load i64, i64* @a, align 8, !dbg !81, !tbaa !49
  tail call void @llvm.dbg.value(metadata %struct.B* %d, i64 0, metadata !39, metadata !79), !dbg !82
  %call = call %struct.B* @_ZN1BC1El(%struct.B* %d, i64 %0), !dbg !82
  call void @llvm.dbg.value(metadata i8 1, i64 0, metadata !38, metadata !83), !dbg !80
  call void @llvm.dbg.value(metadata i8 1, i64 0, metadata !38, metadata !84), !dbg !80
  call void @llvm.dbg.value(metadata i8 1, i64 0, metadata !74, metadata !83), !dbg !77
  call void @llvm.dbg.value(metadata i8 1, i64 0, metadata !74, metadata !84), !dbg !77
  call void @llvm.dbg.declare(metadata %struct.A* undef, metadata !74, metadata !46), !dbg !77
  %1 = getelementptr inbounds %struct.A, %struct.A* %agg.tmp.i.i, i64 0, i32 0, !dbg !85
  call void @llvm.lifetime.start(i64 24, i8* %1), !dbg !85
  %2 = load i64, i64* @a, align 8, !dbg !87, !tbaa !49
  %call.i.i5 = invoke noalias i8* @_Znwm(i64 %2) #5
          to label %call.i.i.noexc unwind label %lpad, !dbg !88

call.i.i.noexc:                                   ; preds = %entry
  %agg.tmp.sroa.4.17..sroa_idx = getelementptr inbounds [7 x i8], [7 x i8]* %agg.tmp.sroa.4, i64 0, i64 0, !dbg !89
  %agg.tmp.sroa.2.1..sroa_idx = getelementptr inbounds [15 x i8], [15 x i8]* %agg.tmp.sroa.2, i64 0, i64 0, !dbg !89
  store i8* %call.i.i5, i8** bitcast (i32** @b to i8**), align 8, !dbg !90, !tbaa !55
  store i8 1, i8* %1, align 8, !dbg !91
  %agg.tmp.sroa.2.0..sroa_raw_idx = getelementptr inbounds i8, i8* %1, i64 1, !dbg !91
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %agg.tmp.sroa.2.0..sroa_raw_idx, i8* %agg.tmp.sroa.2.1..sroa_idx, i64 15, i32 1, i1 false), !dbg !91
  %agg.tmp.sroa.3.0..sroa_idx = getelementptr inbounds %struct.A, %struct.A* %agg.tmp.i.i, i64 0, i32 2, !dbg !91
  store i8 1, i8* %agg.tmp.sroa.3.0..sroa_idx, align 8, !dbg !91
  %agg.tmp.sroa.4.0..sroa_raw_idx = getelementptr inbounds i8, i8* %1, i64 17, !dbg !91
  call void @llvm.memcpy.p0i8.p0i8.i64(i8* %agg.tmp.sroa.4.0..sroa_raw_idx, i8* %agg.tmp.sroa.4.17..sroa_idx, i64 7, i32 1, i1 false), !dbg !91
  invoke void @_Z2f91A(%struct.A* %agg.tmp.i.i)
          to label %invoke.cont unwind label %lpad, !dbg !92

invoke.cont:                                      ; preds = %call.i.i.noexc
  call void @llvm.lifetime.end(i64 24, i8* %1), !dbg !93
  call void @llvm.dbg.value(metadata %struct.B* %d, i64 0, metadata !39, metadata !79), !dbg !82
  %call1 = call %struct.B* @_ZN1BD1Ev(%struct.B* %d) #3, !dbg !94
  ret void, !dbg !94

lpad:                                             ; preds = %call.i.i.noexc, %entry
  %3 = landingpad { i8*, i32 } personality i8* bitcast (i32 (...)* @__gxx_personality_v0 to i8*)
          cleanup, !dbg !94
  call void @llvm.dbg.value(metadata %struct.B* %d, i64 0, metadata !39, metadata !79), !dbg !82
  %call2 = call %struct.B* @_ZN1BD1Ev(%struct.B* %d) #3, !dbg !94
  resume { i8*, i32 } %3, !dbg !94
}

declare %struct.B* @_ZN1BC1El(%struct.B*, i64)

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare %struct.B* @_ZN1BD1Ev(%struct.B*) #4

; Function Attrs: nounwind readnone
declare void @llvm.dbg.value(metadata, i64, metadata, metadata) #1

; Function Attrs: nounwind
declare void @llvm.lifetime.start(i64, i8* nocapture) #3

; Function Attrs: nounwind
declare void @llvm.lifetime.end(i64, i8* nocapture) #3

attributes #1 = { nounwind readnone }
attributes #2 = { nobuiltin }
attributes #3 = { nounwind }
attributes #4 = { nounwind  }
attributes #5 = { builtin }

!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!43, !44}
!llvm.ident = !{!45}

!0 = !MDCompileUnit(language: DW_LANG_C_plus_plus, producer: "clang version 3.7.0 ", isOptimized: true, emissionKind: 1, file: !1, enums: !2, retainedTypes: !3, subprograms: !24, globals: !40, imports: !2)
!1 = !MDFile(filename: "<stdin>", directory: "")
!2 = !{}
!3 = !{!4, !12, !14}
!4 = !MDCompositeType(tag: DW_TAG_structure_type, name: "A", line: 2, size: 192, align: 64, file: !5, elements: !6, identifier: "_ZTS1A")
!5 = !MDFile(filename: "test.cpp", directory: "")
!6 = !{!7, !9, !11}
!7 = !MDDerivedType(tag: DW_TAG_member, name: "x4", line: 3, size: 8, align: 8, file: !5, scope: !"_ZTS1A", baseType: !8)
!8 = !MDBasicType(tag: DW_TAG_base_type, name: "bool", size: 8, align: 8, encoding: DW_ATE_boolean)
!9 = !MDDerivedType(tag: DW_TAG_member, name: "x5", line: 4, size: 64, align: 64, offset: 64, file: !5, scope: !"_ZTS1A", baseType: !10)
!10 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: null)
!11 = !MDDerivedType(tag: DW_TAG_member, name: "x6", line: 5, size: 8, align: 8, offset: 128, file: !5, scope: !"_ZTS1A", baseType: !8)
!12 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, baseType: !13)
!13 = !MDBasicType(tag: DW_TAG_base_type, name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
!14 = !MDCompositeType(tag: DW_TAG_structure_type, name: "B", line: 8, size: 8, align: 8, file: !5, elements: !15, identifier: "_ZTS1B")
!15 = !{!16, !21}
!16 = !MDSubprogram(name: "B", line: 9, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 9, file: !5, scope: !"_ZTS1B", type: !17)
!17 = !MDSubroutineType(types: !18)
!18 = !{null, !19, !20}
!19 = !MDDerivedType(tag: DW_TAG_pointer_type, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer, baseType: !"_ZTS1B")
!20 = !MDBasicType(tag: DW_TAG_base_type, name: "long int", size: 64, align: 64, encoding: DW_ATE_signed)
!21 = !MDSubprogram(name: "~B", line: 10, isLocal: false, isDefinition: false, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 10, file: !5, scope: !"_ZTS1B", type: !22)
!22 = !MDSubroutineType(types: !23)
!23 = !{null, !19}
!24 = !{!25, !31, !34}
!25 = !MDSubprogram(name: "f13", linkageName: "_Z3f131A", line: 13, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 13, file: !5, scope: !26, type: !27, function: void (%struct.A*)* @_Z3f131A, variables: !29)
!26 = !MDFile(filename: "test.cpp", directory: "")
!27 = !MDSubroutineType(types: !28)
!28 = !{null, !"_ZTS1A"}
!29 = !{!30}
!30 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "p1", line: 13, arg: 1, scope: !25, file: !26, type: !"_ZTS1A")
!31 = !MDSubprogram(name: "f11", linkageName: "_Z3f111A", line: 17, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 17, file: !5, scope: !26, type: !27, function: void (%struct.A*)* @_Z3f111A, variables: !32)
!32 = !{!33}
!33 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "p1", line: 17, arg: 1, scope: !31, file: !26, type: !"_ZTS1A")
!34 = !MDSubprogram(name: "f16", linkageName: "_Z3f16v", line: 18, isLocal: false, isDefinition: true, flags: DIFlagPrototyped, isOptimized: true, scopeLine: 18, file: !5, scope: !26, type: !35, function: void ()* @_Z3f16v, variables: !37)
!35 = !MDSubroutineType(types: !36)
!36 = !{null}
!37 = !{!38, !39}
!38 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "c", line: 19, scope: !34, file: !26, type: !"_ZTS1A")
!39 = !MDLocalVariable(tag: DW_TAG_auto_variable, name: "d", line: 20, scope: !34, file: !26, type: !"_ZTS1B")
!40 = !{!41, !42}
!41 = !MDGlobalVariable(name: "a", line: 1, isLocal: false, isDefinition: true, scope: null, file: !26, type: !20, variable: i64* @a)
!42 = !MDGlobalVariable(name: "b", line: 7, isLocal: false, isDefinition: true, scope: null, file: !26, type: !12, variable: i32** @b)
!43 = !{i32 2, !"Dwarf Version", i32 2}
!44 = !{i32 2, !"Debug Info Version", i32 3}
!45 = !{!"clang version 3.7.0 "}
!46 = !MDExpression(DW_OP_deref)
!47 = !MDLocation(line: 13, column: 12, scope: !25)
!48 = !MDLocation(line: 14, column: 37, scope: !25)
!49 = !{!50, !50, i64 0}
!50 = !{!"long", !51, i64 0}
!51 = !{!"omnipotent char", !52, i64 0}
!52 = !{!"Simple C/C++ TBAA"}
!53 = !MDLocation(line: 14, column: 14, scope: !25)
!54 = !MDLocation(line: 14, column: 5, scope: !25)
!55 = !{!56, !56, i64 0}
!56 = !{!"any pointer", !51, i64 0}
!57 = !MDLocation(line: 15, column: 6, scope: !25)
!58 = !{i64 0, i64 1, !59, i64 8, i64 8, !55, i64 16, i64 1, !59}
!59 = !{!60, !60, i64 0}
!60 = !{!"bool", !51, i64 0}
!61 = !MDLocation(line: 15, column: 3, scope: !25)
!62 = !MDLocation(line: 16, column: 1, scope: !25)
!63 = !MDLocation(line: 17, column: 12, scope: !31)
!64 = !MDLocation(line: 17, column: 22, scope: !31)
!65 = !MDLocation(line: 13, column: 12, scope: !25, inlinedAt: !66)
!66 = distinct !MDLocation(line: 17, column: 18, scope: !31)
!67 = !MDLocation(line: 14, column: 37, scope: !25, inlinedAt: !66)
!68 = !MDLocation(line: 14, column: 14, scope: !25, inlinedAt: !66)
!69 = !MDLocation(line: 14, column: 5, scope: !25, inlinedAt: !66)
!70 = !MDLocation(line: 15, column: 6, scope: !25, inlinedAt: !66)
!71 = !MDLocation(line: 15, column: 3, scope: !25, inlinedAt: !66)
!72 = !MDLocation(line: 16, column: 1, scope: !25, inlinedAt: !66)
!73 = !MDLocation(line: 17, column: 27, scope: !31)
!74 = !MDLocalVariable(tag: DW_TAG_arg_variable, name: "p1", line: 17, arg: 1, scope: !31, file: !26, type: !"_ZTS1A", inlinedAt: !75)
!75 = distinct !MDLocation(line: 22, column: 3, scope: !34)
!76 = !MDExpression(DW_OP_bit_piece, 8, 120)
!77 = !MDLocation(line: 17, column: 12, scope: !31, inlinedAt: !75)
!78 = !MDExpression(DW_OP_bit_piece, 136, 56)
!79 = !MDExpression()
!80 = !MDLocation(line: 19, column: 5, scope: !34)
!81 = !MDLocation(line: 20, column: 7, scope: !34)
!82 = !MDLocation(line: 20, column: 5, scope: !34)
!83 = !MDExpression(DW_OP_bit_piece, 0, 8)
!84 = !MDExpression(DW_OP_bit_piece, 128, 8)
!85 = !MDLocation(line: 13, column: 12, scope: !25, inlinedAt: !86)
!86 = distinct !MDLocation(line: 17, column: 18, scope: !31, inlinedAt: !75)
!87 = !MDLocation(line: 14, column: 37, scope: !25, inlinedAt: !86)
!88 = !MDLocation(line: 14, column: 14, scope: !25, inlinedAt: !86)
!89 = !MDLocation(line: 22, column: 7, scope: !34)
!90 = !MDLocation(line: 14, column: 5, scope: !25, inlinedAt: !86)
!91 = !MDLocation(line: 15, column: 6, scope: !25, inlinedAt: !86)
!92 = !MDLocation(line: 15, column: 3, scope: !25, inlinedAt: !86)
!93 = !MDLocation(line: 16, column: 1, scope: !25, inlinedAt: !86)
!94 = !MDLocation(line: 23, column: 1, scope: !34)