forked from llvm/llvm-project
- Notifications
You must be signed in to change notification settings - Fork 339
/
Copy pathDILocation-implicit-code.ll
190 lines (160 loc) · 9.06 KB
/
DILocation-implicit-code.ll
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
; RUN: llvm-dis %s.bc -o - | FileCheck %s
; ModuleID = 'DILocation-implicit-code.cpp'
source_filename = "DILocation-implicit-code.cpp"
targetdatalayout = "e-m:e-i64:64-f80:128-n8:16:32:64-S128"
targettriple = "x86_64-unknown-linux-gnu"
%struct.A = type { i8 }
$_ZN1AC2Ev = comdat any
$_ZN1A3fooEi = comdat any
@_ZTIi = external dso_local constanti8*
; Function Attrs: noinline optnone uwtable
define dso_local void@_Z5test1v() #0personalityi8*bitcast (i32 (...)* @__gxx_personality_v0toi8*) !dbg!7 {
entry:
%retval = alloca%struct.A, align1
%a = alloca%struct.A, align1
%exn.slot = allocai8*
%ehselector.slot = allocai32
%undef.agg.tmp = alloca%struct.A, align1
%e = allocai32, align4
%undef.agg.tmp3 = alloca%struct.A, align1
callvoid@_ZN1AC2Ev(%struct.A*%a), !dbg!9
invokevoid@_ZN1A3fooEi(%struct.A*%a, i320)
tolabel%invoke.contunwindlabel%lpad, !dbg!10
invoke.cont: ; preds = %entry
brlabel%return, !dbg!11
lpad: ; preds = %entry
%0 = landingpad { i8*, i32 }
catch i8*bitcast (i8**@_ZTIitoi8*), !dbg!12
%1 = extractvalue { i8*, i32 } %0, 0, !dbg!12
storei8*%1, i8**%exn.slot, align8, !dbg!12
%2 = extractvalue { i8*, i32 } %0, 1, !dbg!12
storei32%2, i32*%ehselector.slot, align4, !dbg!12
brlabel%catch.dispatch, !dbg!12
catch.dispatch: ; preds = %lpad
%sel = loadi32, i32*%ehselector.slot, align4, !dbg!13
%3 = calli32@llvm.eh.typeid.for(i8*bitcast (i8**@_ZTIitoi8*)) #4, !dbg!13
%matches = icmpeqi32%sel, %3, !dbg!13
bri1%matches, label%catch, label%eh.resume, !dbg!13
catch: ; preds = %catch.dispatch
%exn = loadi8*, i8**%exn.slot, align8, !dbg!13
%4 = calli8*@__cxa_begin_catch(i8*%exn) #4, !dbg!13
%5 = bitcasti8*%4toi32*, !dbg!13
%6 = loadi32, i32*%5, align4, !dbg!13
storei32%6, i32*%e, align4, !dbg!13
%7 = loadi32, i32*%e, align4, !dbg!14
invokevoid@_ZN1A3fooEi(%struct.A*%a, i32%7)
tolabel%invoke.cont2unwindlabel%lpad1, !dbg!15
invoke.cont2: ; preds = %catch
callvoid@__cxa_end_catch() #4, !dbg!16
brlabel%return
lpad1: ; preds = %catch
%8 = landingpad { i8*, i32 }
cleanup, !dbg!12
%9 = extractvalue { i8*, i32 } %8, 0, !dbg!12
storei8*%9, i8**%exn.slot, align8, !dbg!12
%10 = extractvalue { i8*, i32 } %8, 1, !dbg!12
storei32%10, i32*%ehselector.slot, align4, !dbg!12
callvoid@__cxa_end_catch() #4, !dbg!16
brlabel%eh.resume, !dbg!16
try.cont: ; No predecessors!
callvoid@llvm.trap(), !dbg!16
unreachable, !dbg!16
return: ; preds = %invoke.cont2, %invoke.cont
retvoid, !dbg!12
eh.resume: ; preds = %lpad1, %catch.dispatch
%exn4 = loadi8*, i8**%exn.slot, align8, !dbg!13
%sel5 = loadi32, i32*%ehselector.slot, align4, !dbg!13
%lpad.val = insertvalue { i8*, i32 } undef, i8*%exn4, 0, !dbg!13
%lpad.val6 = insertvalue { i8*, i32 } %lpad.val, i32%sel5, 1, !dbg!13
resume { i8*, i32 } %lpad.val6, !dbg!13
}
; Function Attrs: noinline nounwind optnone uwtable
definelinkonce_odr dso_local void@_ZN1AC2Ev(%struct.A*%this) unnamed_addr #1 comdat align2!dbg!17 {
entry:
%this.addr = alloca%struct.A*, align8
store%struct.A*%this, %struct.A**%this.addr, align8
%this1 = load%struct.A*, %struct.A**%this.addr, align8
retvoid, !dbg!18
}
; Function Attrs: noinline optnone uwtable
definelinkonce_odr dso_local void@_ZN1A3fooEi(%struct.A*%this, i32%i) #0 comdat align2!dbg!19 {
entry:
%retval = alloca%struct.A, align1
%this.addr = alloca%struct.A*, align8
%i.addr = allocai32, align4
store%struct.A*%this, %struct.A**%this.addr, align8
storei32%i, i32*%i.addr, align4
%this1 = load%struct.A*, %struct.A**%this.addr, align8
%0 = loadi32, i32*%i.addr, align4, !dbg!20
%cmp = icmpeqi32%0, 0, !dbg!21
bri1%cmp, label%if.then, label%if.end, !dbg!20
if.then: ; preds = %entry
%exception = calli8*@__cxa_allocate_exception(i644) #4, !dbg!22
%1 = bitcasti8*%exceptiontoi32*, !dbg!22
storei321, i32*%1, align16, !dbg!22
callvoid@__cxa_throw(i8*%exception, i8*bitcast (i8**@_ZTIitoi8*), i8*null) #5, !dbg!22
unreachable, !dbg!22
if.end: ; preds = %entry
retvoid, !dbg!23
}
declare dso_local i32@__gxx_personality_v0(...)
; Function Attrs: nounwind readnone
declarei32@llvm.eh.typeid.for(i8*) #2
declare dso_local i8*@__cxa_begin_catch(i8*)
declare dso_local void@__cxa_end_catch()
; Function Attrs: noreturn nounwind
declarevoid@llvm.trap() #3
; Function Attrs: noinline optnone uwtable
define dso_local void@_Z5test2v() #0!dbg!24 {
entry:
%a = alloca%struct.A, align1
%b = alloca%struct.A, align1
%undef.agg.tmp = alloca%struct.A, align1
callvoid@_ZN1AC2Ev(%struct.A*%a), !dbg!25
callvoid@_ZN1A3fooEi(%struct.A*%a, i321), !dbg!26
retvoid, !dbg!27
}
declare dso_local i8*@__cxa_allocate_exception(i64)
declare dso_local void@__cxa_throw(i8*, i8*, i8*)
attributes #0 = { noinlineoptnoneuwtable"correctly-rounded-divide-sqrt-fp-math"="false""disable-tail-calls"="false""less-precise-fpmad"="false""frame-pointer"="all""no-infs-fp-math"="false""no-jump-tables"="false""no-nans-fp-math"="false""no-signed-zeros-fp-math"="false""no-trapping-math"="false""stack-protector-buffer-size"="8""target-cpu"="x86-64""target-features"="+fxsr,+mmx,+sse,+sse2,+x87""unsafe-fp-math"="false""use-soft-float"="false" }
attributes #1 = { noinlinenounwindoptnoneuwtable"correctly-rounded-divide-sqrt-fp-math"="false""disable-tail-calls"="false""less-precise-fpmad"="false""frame-pointer"="all""no-infs-fp-math"="false""no-jump-tables"="false""no-nans-fp-math"="false""no-signed-zeros-fp-math"="false""no-trapping-math"="false""stack-protector-buffer-size"="8""target-cpu"="x86-64""target-features"="+fxsr,+mmx,+sse,+sse2,+x87""unsafe-fp-math"="false""use-soft-float"="false" }
attributes #2 = { nounwindreadnone }
attributes #3 = { noreturnnounwind }
attributes #4 = { nounwind }
attributes #5 = { noreturn }
!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!3, !4, !5}
!llvm.ident = !{!6}
; CHECK: !DILocation(line: 20, column: 1, scope: !{{[0-9]+}}, isImplicitCode: true)
; CHECK: !DILocation(line: 17, column: 5, scope: !{{[0-9]+}}, isImplicitCode: true)
; CHECK: !DILocation(line: 19, column: 5, scope: !{{[0-9]+}}, isImplicitCode: true)
; CHECK: !DILocation(line: 3, column: 10, scope: !{{[0-9]+}}, isImplicitCode: true)
; CHECK: !DILocation(line: 25, column: 1, scope: !{{[0-9]+}}, isImplicitCode: true)
!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 8.0.0 (trunk 342445)", isOptimized: false, runtimeVersion: 0, emissionKind: LineTablesOnly, enums: !2, nameTableKind: None)
!1 = !DIFile(filename: "DILocation-implicit-code.cpp", directory: "/tmp")
!2 = !{}
!3 = !{i322, !"Dwarf Version", i324}
!4 = !{i322, !"Debug Info Version", i323}
!5 = !{i321, !"wchar_size", i324}
!6 = !{!"clang version 8.0.0 (trunk 342445)"}
!7 = distinct !DISubprogram(name: "test1", scope: !1, file: !1, line: 13, type: !8, isLocal: false, isDefinition: true, scopeLine: 13, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
!8 = !DISubroutineType(types: !2)
!9 = !DILocation(line: 14, column: 7, scope: !7)
!10 = !DILocation(line: 16, column: 18, scope: !7)
!11 = !DILocation(line: 16, column: 9, scope: !7)
!12 = !DILocation(line: 20, column: 1, scope: !7, isImplicitCode: true)
!13 = !DILocation(line: 17, column: 5, scope: !7, isImplicitCode: true)
!14 = !DILocation(line: 18, column: 22, scope: !7)
!15 = !DILocation(line: 18, column: 18, scope: !7)
!16 = !DILocation(line: 19, column: 5, scope: !7, isImplicitCode: true)
!17 = distinct !DISubprogram(name: "A", scope: !1, file: !1, line: 3, type: !8, isLocal: false, isDefinition: true, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
!18 = !DILocation(line: 3, column: 10, scope: !17, isImplicitCode: true)
!19 = distinct !DISubprogram(name: "foo", scope: !1, file: !1, line: 4, type: !8, isLocal: false, isDefinition: true, scopeLine: 4, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
!20 = !DILocation(line: 5, column: 13, scope: !19)
!21 = !DILocation(line: 5, column: 15, scope: !19)
!22 = !DILocation(line: 6, column: 13, scope: !19)
!23 = !DILocation(line: 9, column: 9, scope: !19)
!24 = distinct !DISubprogram(name: "test2", scope: !1, file: !1, line: 22, type: !8, isLocal: false, isDefinition: true, scopeLine: 22, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
!25 = !DILocation(line: 23, column: 7, scope: !24)
!26 = !DILocation(line: 24, column: 13, scope: !24)
!27 = !DILocation(line: 25, column: 1, scope: !24, isImplicitCode: true)