File: noreturn.ll

package info (click to toggle)
llvm-toolchain-19 1%3A19.1.7-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,998,520 kB
  • sloc: cpp: 6,951,680; ansic: 1,486,157; asm: 913,598; python: 232,024; f90: 80,126; objc: 75,281; lisp: 37,276; pascal: 16,990; sh: 10,009; ml: 5,058; perl: 4,724; awk: 3,523; makefile: 3,167; javascript: 2,504; xml: 892; fortran: 664; cs: 573
file content (144 lines) | stat: -rw-r--r-- 7,698 bytes parent folder | download | duplicates (10)
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
; RUN: llc < %s -filetype=obj | llvm-readobj --codeview - | FileCheck %s

; Generated by clang++ -S -c -std=c++11 -emit-llvm -g from the following C++11 source:
;class foo {
;public:
;[[noreturn]] void foo_member(){throw 1;}
;};
;
;[[ noreturn ]] void f() {
;    throw 1;
;}
;
;void func(){
;    foo object{};
;    object.foo_member();
;}

; CHECK-LABEL:  FunctionType: f (0x1002)
; CHECK-NEXT:   CodeOffset: ?f@@YAXXZ+0x0
; CHECK-NEXT:   Segment: 0x0
; CHECK-NEXT:   Flags [ (0xC8)
; CHECK-NEXT:     HasOptimizedDebugInfo (0x80)
; CHECK-NEXT:     IsNoInline (0x40)
; CHECK-NEXT:     IsNoReturn (0x8)
; CHECK-NEXT:   ]
; CHECK-NEXT:   DisplayName: f
; CHECK-NEXT:   LinkageName: ?f@@YAXXZ
; CHECK-LABEL:  FunctionType: foo_member (0x100B)
; CHECK-NEXT:   CodeOffset: ?foo_member@foo@@QEAAXXZ+0x0
; CHECK-NEXT:   Segment: 0x0
; CHECK-NEXT:   Flags [ (0xC8)
; CHECK-NEXT:     HasOptimizedDebugInfo (0x80)
; CHECK-NEXT:     IsNoInline (0x40)
; CHECK-NEXT:     IsNoReturn (0x8)
; CHECK-NEXT:   ]
; CHECK-NEXT:   DisplayName: foo::foo_member
; CHECK-NEXT:   LinkageName: ?foo_member@foo@@QEAAXXZ


; ModuleID = 'noreturn.cpp'
source_filename = "noreturn.cpp"
target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
target triple = "x86_64-pc-windows-msvc19.35.32216"

%rtti.TypeDescriptor2 = type { ptr, ptr, [3 x i8] }
%eh.CatchableType = type { i32, i32, i32, i32, i32, i32, i32 }
%eh.CatchableTypeArray.1 = type { i32, [1 x i32] }
%eh.ThrowInfo = type { i32, i32, i32, i32 }
%class.foo = type { i8 }

$"?foo_member@foo@@QEAAXXZ" = comdat any

$"??_R0H@8" = comdat any

$"_CT??_R0H@84" = comdat any

$_CTA1H = comdat any

$_TI1H = comdat any

@"??_7type_info@@6B@" = external constant ptr
@"??_R0H@8" = linkonce_odr global %rtti.TypeDescriptor2 { ptr @"??_7type_info@@6B@", ptr null, [3 x i8] c".H\00" }, comdat
@__ImageBase = external dso_local constant i8
@"_CT??_R0H@84" = linkonce_odr unnamed_addr constant %eh.CatchableType { i32 1, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (ptr @"??_R0H@8" to i64), i64 ptrtoint (ptr @__ImageBase to i64)) to i32), i32 0, i32 -1, i32 0, i32 4, i32 0 }, section ".xdata", comdat
@_CTA1H = linkonce_odr unnamed_addr constant %eh.CatchableTypeArray.1 { i32 1, [1 x i32] [i32 trunc (i64 sub nuw nsw (i64 ptrtoint (ptr @"_CT??_R0H@84" to i64), i64 ptrtoint (ptr @__ImageBase to i64)) to i32)] }, section ".xdata", comdat
@_TI1H = linkonce_odr unnamed_addr constant %eh.ThrowInfo { i32 0, i32 0, i32 0, i32 trunc (i64 sub nuw nsw (i64 ptrtoint (ptr @_CTA1H to i64), i64 ptrtoint (ptr @__ImageBase to i64)) to i32) }, section ".xdata", comdat
@"__const.?func@@YAXXZ.object" = private unnamed_addr constant %class.foo undef, align 1

; Function Attrs: mustprogress noinline noreturn optnone uwtable
define dso_local void @"?f@@YAXXZ"() #0 !dbg !8 {
  %1 = alloca i32, align 4
  store i32 1, ptr %1, align 4, !dbg !13
  call void @_CxxThrowException(ptr %1, ptr @_TI1H) #4, !dbg !13
  unreachable, !dbg !13
}

declare dso_local void @_CxxThrowException(ptr, ptr)

; Function Attrs: mustprogress noinline optnone uwtable
define dso_local void @"?func@@YAXXZ"() #1 !dbg !14 {
  %1 = alloca %class.foo, align 1
  call void @llvm.dbg.declare(metadata ptr %1, metadata !15, metadata !DIExpression()), !dbg !22
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %1, ptr align 1 @"__const.?func@@YAXXZ.object", i64 1, i1 false), !dbg !22
  call void @"?foo_member@foo@@QEAAXXZ"(ptr noundef nonnull align 1 dereferenceable(1) %1) #4, !dbg !23
  unreachable, !dbg !23
}

; Function Attrs: nocallback nofree nosync nounwind readnone speculatable willreturn
declare void @llvm.dbg.declare(metadata, metadata, metadata) #2

; Function Attrs: argmemonly nocallback nofree nounwind willreturn
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: mustprogress noinline noreturn optnone uwtable
define linkonce_odr dso_local void @"?foo_member@foo@@QEAAXXZ"(ptr noundef nonnull align 1 dereferenceable(1) %0) #0 comdat align 2 !dbg !24 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  store ptr %0, ptr %2, align 8
  call void @llvm.dbg.declare(metadata ptr %2, metadata !25, metadata !DIExpression()), !dbg !27
  %4 = load ptr, ptr %2, align 8
  store i32 1, ptr %3, align 4, !dbg !28
  call void @_CxxThrowException(ptr %3, ptr @_TI1H) #4, !dbg !28
  unreachable, !dbg !28
}

attributes #0 = { mustprogress noinline noreturn optnone uwtable "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress noinline optnone uwtable "frame-pointer"="none" "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind readnone speculatable willreturn }
attributes #3 = { argmemonly nocallback nofree nounwind willreturn }
attributes #4 = { noreturn }

!llvm.dbg.cu = !{!0}
!llvm.module.flags = !{!2, !3, !4, !5, !6}
!llvm.ident = !{!7}

!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_11, file: !1, producer: "clang version 15.0.1", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, splitDebugInlining: false, nameTableKind: None)
!1 = !DIFile(filename: "noreturn.cpp", directory: "C:\\llvm", checksumkind: CSK_MD5, checksum: "4431274b41f9156c1861249cc2d5fbc6")
!2 = !{i32 2, !"CodeView", i32 1}
!3 = !{i32 2, !"Debug Info Version", i32 3}
!4 = !{i32 1, !"wchar_size", i32 2}
!5 = !{i32 7, !"PIC Level", i32 2}
!6 = !{i32 7, !"uwtable", i32 2}
!7 = !{!"clang version 15.0.1"}
!8 = distinct !DISubprogram(name: "f", linkageName: "?f@@YAXXZ", scope: !9, file: !9, line: 6, type: !10, scopeLine: 6, flags: DIFlagPrototyped | DIFlagNoReturn, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !12)
!9 = !DIFile(filename: "noreturn.cpp", directory: "", checksumkind: CSK_MD5, checksum: "4431274b41f9156c1861249cc2d5fbc6")
!10 = !DISubroutineType(types: !11)
!11 = !{null}
!12 = !{}
!13 = !DILocation(line: 7, scope: !8)
!14 = distinct !DISubprogram(name: "func", linkageName: "?func@@YAXXZ", scope: !9, file: !9, line: 10, type: !10, scopeLine: 10, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !12)
!15 = !DILocalVariable(name: "object", scope: !14, file: !9, line: 11, type: !16)
!16 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "foo", file: !9, line: 1, size: 8, flags: DIFlagTypePassByValue, elements: !17, identifier: ".?AVfoo@@")
!17 = !{!18}
!18 = !DISubprogram(name: "foo_member", linkageName: "?foo_member@foo@@QEAAXXZ", scope: !16, file: !9, line: 3, type: !19, scopeLine: 3, flags: DIFlagPublic | DIFlagPrototyped | DIFlagNoReturn, spFlags: 0)
!19 = !DISubroutineType(types: !20)
!20 = !{null, !21}
!21 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !16, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
!22 = !DILocation(line: 11, scope: !14)
!23 = !DILocation(line: 12, scope: !14)
!24 = distinct !DISubprogram(name: "foo_member", linkageName: "?foo_member@foo@@QEAAXXZ", scope: !16, file: !9, line: 3, type: !19, scopeLine: 3, flags: DIFlagPrototyped | DIFlagNoReturn, spFlags: DISPFlagDefinition, unit: !0, declaration: !18, retainedNodes: !12)
!25 = !DILocalVariable(name: "this", arg: 1, scope: !24, type: !26, flags: DIFlagArtificial | DIFlagObjectPointer)
!26 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !16, size: 64)
!27 = !DILocation(line: 0, scope: !24)
!28 = !DILocation(line: 3, scope: !24)