Wiki Roadmap Timeline Tickets New Ticket Source Search Help / Guide About Trac Login

Ticket #340: switch_good.ll

File switch_good.ll, 12.3 kB (added by revcompgeek, 3 years ago)

Generated LLVM IR for good module

Line 
1 ; ModuleID = 'test'
2 target datalayout = "E-p:32:32:32-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:32:64-f32:32:32-f64:32:64-v64:64:64-v128:128:128-a0:0:64-f128:64:128"
3 target triple = "powerpc-apple-darwin9.6.0"
4     type { i32, i32, i8*, i32, %1 }     ; type %0
5     type { i32, i32 }       ; type %1
6     type opaque     ; type %2
7     type opaque     ; type %3
8     type opaque     ; type %4
9     type opaque     ; type %5
10     type opaque     ; type %6
11     type { %object.ModuleInfo.__vtbl*, i8*, %"byte[]", %8, %"ClassInfo[]", i32, void ()*, void ()*, void ()*, i8*, void ()* }       ; type %7
12     type { i32, %object.ModuleInfo* }       ; type %8
13     type { i32, void ()* }      ; type %9
14     %"ClassInfo[]" = type { i32, %object.ClassInfo** }
15     %D_CRITICAL_SECTION = type { %D_CRITICAL_SECTION*, %0 }
16     %"Interface[]" = type { i32, %object.Interface* }
17     %"ModuleInfo[]" = type { i32, %object.ModuleInfo** }
18     %ModuleReference = type { %ModuleReference*, %object.ModuleInfo* }
19     %"OffsetTypeInfo[]" = type { i32, %object.OffsetTypeInfo* }
20     %"byte[]" = type { i32, i8* }
21     %"char[]" = type { i32, i8* }
22     %"char[][]" = type { i32, %"byte[]"* }
23     %"int delegate(ref ModuleInfo)" = type { i8*, i32 (i8*, %object.ModuleInfo**)* }
24     %object.ClassInfo = type { %object.ClassInfo.__vtbl*, i8*, %"byte[]", %"byte[]", %"void*[]", %"Interface[]", %object.ClassInfo*, i8*, i8*, i32, i8*, %"OffsetTypeInfo[]", i8*, %object.TypeInfo* }
25     %object.ClassInfo.__vtbl = type { %object.ClassInfo*, %"byte[]" (%object.Object*)*, i32 (%object.Object*)*, i32 (%object.Object*, %object.Object*)*, i32 (%object.Object*, %object.Object*)*, %object.Object* (%object.ClassInfo*)* }
26     %object.Interface = type { %object.ClassInfo*, %"void*[]", i32 }
27     %object.ModuleInfo = type { %object.ModuleInfo.__vtbl*, i8*, %"byte[]", %"ModuleInfo[]", %"ClassInfo[]", i32, void ()*, void ()*, void ()*, i8*, void ()* }
28     %object.ModuleInfo.__vtbl = type { %object.ClassInfo*, %"byte[]" (%object.Object*)*, i32 (%object.Object*)*, i32 (%object.Object*, %object.Object*)*, i32 (%object.Object*, %object.Object*)* }
29     %object.Object = type { %object.ModuleInfo.__vtbl*, i8* }
30     %object.Object.Monitor = type { %object.Object.Monitor.__vtbl* }
31     %object.Object.Monitor.__vtbl = type { %object.ClassInfo*, void (%object.Object.Monitor*)*, void (%object.Object.Monitor*)* }
32     %object.Object.__vtbl = type { %object.ClassInfo*, %"byte[]" (%object.Object*)*, i32 (%object.Object*)*, i32 (%object.Object*, %object.Object*)*, i32 (%object.Object*, %object.Object*)* }
33     %object.OffsetTypeInfo = type { i32, %object.TypeInfo* }
34     %object.TypeInfo = type { %object.TypeInfo.__vtbl*, i8* }
35     %object.TypeInfo.__vtbl = type { %object.ClassInfo*, %"byte[]" (%object.Object*)*, i32 (%object.Object*)*, i32 (%object.Object*, %object.Object*)*, i32 (%object.Object*, %object.Object*)*, i32 (%object.TypeInfo*, i8*)*, i32 (%object.TypeInfo*, i8*, i8*)*, i32 (%object.TypeInfo*, i8*, i8*)*, i32 (%object.TypeInfo*)*, void (%object.TypeInfo*, i8*, i8*)*, %object.TypeInfo* (%object.TypeInfo*)*, %"byte[]" (%object.TypeInfo*)*, i32 (%object.TypeInfo*)*, %"OffsetTypeInfo[]" (%object.TypeInfo*)* }
36     %object.TypeInfo_Class = type { %object.TypeInfo.__vtbl*, i8*, %object.ClassInfo* }
37     %object.TypeInfo_Class.__vtbl = type { %object.ClassInfo*, %"byte[]" (%object.Object*)*, i32 (%object.Object*)*, i32 (%object.Object*, %object.Object*)*, i32 (%object.Object*, %object.Object*)*, i32 (%object.TypeInfo*, i8*)*, i32 (%object.TypeInfo*, i8*, i8*)*, i32 (%object.TypeInfo*, i8*, i8*)*, i32 (%object.TypeInfo*)*, void (%object.TypeInfo*, i8*, i8*)*, %object.TypeInfo* (%object.TypeInfo*)*, %"byte[]" (%object.TypeInfo*)*, i32 (%object.TypeInfo*)*, %"OffsetTypeInfo[]" (%object.TypeInfo*)* }
38     %"test.Foo!(int).Foo" = type { %"test.Foo!(int).Foo.__vtbl"*, i8* }
39     %"test.Foo!(int).Foo.__vtbl" = type { %object.ClassInfo*, %"byte[]" (%object.Object*)*, i32 (%object.Object*)*, i32 (%object.Object*, %object.Object*)*, i32 (%object.Object*, %object.Object*)*, void (%"test.Foo!(int).Foo"*)* }
40     %"void*[]" = type { i32, i8** }
41     %"void[]" = type { i32, i8* }
42 @_D6Object7__ClassZ = external global %object.ClassInfo     ; <%object.ClassInfo*> [#uses=1]
43 @_D6Object6__initZ = external constant %2, align 4      ; <%2*> [#uses=0]
44 @_D6Object6__vtblZ = external constant %object.ModuleInfo.__vtbl        ; <%object.ModuleInfo.__vtbl*> [#uses=0]
45 @_D6Object7Monitor11__InterfaceZ = external global %object.ClassInfo        ; <%object.ClassInfo*> [#uses=0]
46 @_D4test10__T3FooTiZ3Foo7__ClassZ = weak_odr global %object.ClassInfo { %object.ClassInfo.__vtbl* @_D9ClassInfo6__vtblZ, i8* null, %"byte[]" { i32 8, i8* bitcast (%"test.Foo!(int).Foo"* @_D4test10__T3FooTiZ3Foo6__initZ to i8*) }, %"byte[]" { i32 18, i8* getelementptr ([19 x i8]* @.str, i32 0, i32 0) }, %"void*[]" { i32 6, i8** bitcast (%"test.Foo!(int).Foo.__vtbl"* @_D4test10__T3FooTiZ3Foo6__vtblZ to i8**) }, %"Interface[]" zeroinitializer, %object.ClassInfo* @_D6Object7__ClassZ, i8* null, i8* null, i32 34, i8* null, %"OffsetTypeInfo[]" zeroinitializer, i8* null, %object.TypeInfo* bitcast (%object.TypeInfo_Class* @_D31TypeInfo_C4test10__T3FooTiZ3Foo6__initZ to %object.TypeInfo*) }       ; <%object.ClassInfo*> [#uses=3]
47 @_D4test10__T3FooTiZ3Foo6__initZ = weak_odr constant %"test.Foo!(int).Foo" { %"test.Foo!(int).Foo.__vtbl"* @_D4test10__T3FooTiZ3Foo6__vtblZ, i8* null }, align 4        ; <%"test.Foo!(int).Foo"*> [#uses=1]
48 @_D4test10__T3FooTiZ3Foo6__vtblZ = weak_odr constant %"test.Foo!(int).Foo.__vtbl" { %object.ClassInfo* @_D4test10__T3FooTiZ3Foo7__ClassZ, %"byte[]" (%object.Object*)* @_D6object6Object8toStringMFZAa, i32 (%object.Object*)* @_D6object6Object6toHashMFZk, i32 (%object.Object*, %object.Object*)* @_D6object6Object5opCmpMFC6ObjectZi, i32 (%object.Object*, %object.Object*)* @_D6object6Object8opEqualsMFC6ObjectZi, void (%"test.Foo!(int).Foo"*)* @_D4test10__T3FooTiZ3Foo3barMFZv }     ; <%"test.Foo!(int).Foo.__vtbl"*> [#uses=3]
49 @_D31TypeInfo_C4test10__T3FooTiZ3Foo6__initZ = linkonce_odr constant %object.TypeInfo_Class { %object.TypeInfo.__vtbl* @_D14TypeInfo_Class6__vtblZ, i8* null, %object.ClassInfo* @_D4test10__T3FooTiZ3Foo7__ClassZ }        ; <%object.TypeInfo_Class*> [#uses=1]
50 @_D8TypeInfo7__ClassZ = external global %object.ClassInfo       ; <%object.ClassInfo*> [#uses=0]
51 @_D8TypeInfo6__initZ = external constant %3, align 4        ; <%3*> [#uses=0]
52 @_D8TypeInfo6__vtblZ = external constant %object.TypeInfo.__vtbl        ; <%object.TypeInfo.__vtbl*> [#uses=0]
53 @_D14TypeInfo_Class7__ClassZ = external global %object.ClassInfo        ; <%object.ClassInfo*> [#uses=0]
54 @_D14TypeInfo_Class6__initZ = external constant %4, align 4     ; <%4*> [#uses=0]
55 @_D14TypeInfo_Class6__vtblZ = external constant %object.TypeInfo.__vtbl     ; <%object.TypeInfo.__vtbl*> [#uses=1]
56 @_D9ClassInfo7__ClassZ = external global %object.ClassInfo      ; <%object.ClassInfo*> [#uses=0]
57 @_D9ClassInfo6__initZ = external constant %5, align 4       ; <%5*> [#uses=0]
58 @_D9ClassInfo6__vtblZ = external constant %object.ClassInfo.__vtbl      ; <%object.ClassInfo.__vtbl*> [#uses=1]
59 @.str = internal constant [19 x i8] c"test.Foo!(int).Foo\00"        ; <[19 x i8]*> [#uses=1]
60 @.str1 = internal constant [10 x i8] c"null this\00"        ; <[10 x i8]*> [#uses=1]
61 @.str2 = internal constant [14 x i8] c"switch_good.d\00"        ; <[14 x i8]*> [#uses=1]
62 @.modulefilename = internal constant %"byte[]" { i32 13, i8* getelementptr ([14 x i8]* @.str2, i32 0, i32 0) }      ; <%"byte[]"*> [#uses=2]
63 @_D10ModuleInfo7__ClassZ = external global %object.ClassInfo        ; <%object.ClassInfo*> [#uses=0]
64 @_D10ModuleInfo6__initZ = external constant %6, align 4     ; <%6*> [#uses=0]
65 @_D10ModuleInfo6__vtblZ = external constant %object.ModuleInfo.__vtbl       ; <%object.ModuleInfo.__vtbl*> [#uses=1]
66 @.str3 = internal constant [5 x i8] c"test\00"      ; <[5 x i8]*> [#uses=1]
67 @_D4test8__ModuleZ = global %7 { %object.ModuleInfo.__vtbl* @_D10ModuleInfo6__vtblZ, i8* null, %"byte[]" { i32 4, i8* getelementptr ([5 x i8]* @.str3, i32 0, i32 0) }, %8 zeroinitializer, %"ClassInfo[]" zeroinitializer, i32 4, void ()* null, void ()* null, void ()* null, i8* null, void ()* null }       ; <%7*> [#uses=1]
68 @_D4test11__moduleRefZ = internal global %ModuleReference { %ModuleReference* null, %object.ModuleInfo* bitcast (%7* @_D4test8__ModuleZ to %object.ModuleInfo*) }       ; <%ModuleReference*> [#uses=2]
69 @_Dmodule_ref = external global %ModuleReference*       ; <%ModuleReference**> [#uses=2]
70 @llvm.global_ctors = appending constant [1 x %9] [%9 { i32 65535, void ()* @_D4test16__moduleinfoCtorZ }]       ; <[1 x %9]*> [#uses=0]
71
72 define fastcc i32 @_Dmain(%"char[][]" %unnamed) {
73 entry:
74     %.newclass_gc_alloc = call noalias i8* @_d_allocclass(%object.ClassInfo* @_D4test10__T3FooTiZ3Foo7__ClassZ)     ; <i8*> [#uses=1]
75     %.newclass_gc = bitcast i8* %.newclass_gc_alloc to %"test.Foo!(int).Foo"*       ; <%"test.Foo!(int).Foo"*> [#uses=2]
76     %vtbl = getelementptr %"test.Foo!(int).Foo"* %.newclass_gc, i32 0, i32 0        ; <%"test.Foo!(int).Foo.__vtbl"**> [#uses=1]
77     store %"test.Foo!(int).Foo.__vtbl"* @_D4test10__T3FooTiZ3Foo6__vtblZ, %"test.Foo!(int).Foo.__vtbl"** %vtbl
78     %monitor = getelementptr %"test.Foo!(int).Foo"* %.newclass_gc, i32 0, i32 1     ; <i8**> [#uses=1]
79     store i8* null, i8** %monitor
80     ret i32 0
81 }
82
83 declare fastcc %"byte[]" @_D6object6Object8toStringMFZAa(%object.Object*)
84
85 declare fastcc i32 @_D6object6Object6toHashMFZk(%object.Object*)
86
87 declare fastcc i32 @_D6object6Object5opCmpMFC6ObjectZi(%object.Object*, %object.Object*)
88
89 declare fastcc i32 @_D6object6Object8opEqualsMFC6ObjectZi(%object.Object*, %object.Object*)
90
91 define weak_odr fastcc void @_D4test10__T3FooTiZ3Foo3barMFZv(%"test.Foo!(int).Foo"* %.this_arg) {
92 entry:
93     %this = alloca %"test.Foo!(int).Foo"*       ; <%"test.Foo!(int).Foo"**> [#uses=3]
94     store %"test.Foo!(int).Foo"* %.this_arg, %"test.Foo!(int).Foo"** %this
95     %tmp = load %"test.Foo!(int).Foo"** %this       ; <%"test.Foo!(int).Foo"*> [#uses=1]
96     %tmp1 = icmp ne %"test.Foo!(int).Foo"* %tmp, null       ; <i1> [#uses=1]
97     br i1 %tmp1, label %noassert, label %assert
98
99 assert:     ; preds = %entry
100     %tmp2 = load %"byte[]"* @.modulefilename        ; <%"byte[]"> [#uses=1]
101     %0 = call i8* @_d_assert_msg(%"byte[]" { i32 9, i8* getelementptr ([10 x i8]* @.str1, i32 0, i32 0) }, %"byte[]" %tmp2, i32 5)      ; <i8*> [#uses=0]
102     unreachable
103
104 noassert:       ; preds = %entry
105     %tmp3 = load %"test.Foo!(int).Foo"** %this      ; <%"test.Foo!(int).Foo"*> [#uses=1]
106     %tmp4 = bitcast %"test.Foo!(int).Foo"* %tmp3 to %object.Object*     ; <%object.Object*> [#uses=1]
107     call void @_d_invariant(%object.Object* %tmp4)
108     switch i32 97, label %default [
109         i32 97, label %case
110         i32 107, label %case5
111         i32 102, label %case6
112         i32 103, label %case7
113     ]
114
115 switchbody:     ; No predecessors!
116     br label %case
117
118 default:        ; preds = %noassert
119     br label %default8
120
121 case:       ; preds = %noassert, %switchbody
122     br label %case5
123
124 case5:      ; preds = %noassert, %case
125     br label %case6
126
127 case6:      ; preds = %noassert, %case5
128     br label %case7
129
130 case7:      ; preds = %noassert, %case6
131     br label %switchend
132
133 afterbreak:     ; No predecessors!
134     br label %default8
135
136 default8:       ; preds = %afterbreak, %default
137     %tmp9 = load %"byte[]"* @.modulefilename        ; <%"byte[]"> [#uses=1]
138     call void @_d_switch_error(%"byte[]" %tmp9, i32 7)
139     unreachable
140
141 switchend:      ; preds = %case7
142     ret void
143 }
144
145 declare fastcc i32 @_D6object8TypeInfo7getHashMFPvZk(%object.TypeInfo*, i8*)
146
147 declare fastcc i32 @_D6object8TypeInfo6equalsMFPvPvZi(%object.TypeInfo*, i8*, i8*)
148
149 declare fastcc i32 @_D6object8TypeInfo7compareMFPvPvZi(%object.TypeInfo*, i8*, i8*)
150
151 declare fastcc i32 @_D6object8TypeInfo5tsizeMFZk(%object.TypeInfo*)
152
153 declare fastcc void @_D6object8TypeInfo4swapMFPvPvZv(%object.TypeInfo*, i8*, i8*)
154
155 declare fastcc %object.TypeInfo* @_D6object8TypeInfo4nextMFZC8TypeInfo(%object.TypeInfo*)
156
157 declare fastcc %"byte[]" @_D6object8TypeInfo4initMFZAv(%object.TypeInfo*)
158
159 declare fastcc i32 @_D6object8TypeInfo5flagsMFZk(%object.TypeInfo*)
160
161 declare fastcc %"OffsetTypeInfo[]" @_D6object8TypeInfo5offTiMFZAS6object14OffsetTypeInfo(%object.TypeInfo*)
162
163 declare fastcc %object.ClassInfo* @_D6object9ClassInfo4findFAaZC9ClassInfo(%"byte[]")
164
165 declare fastcc %object.Object* @_D6object9ClassInfo6createMFZC6Object(%object.ClassInfo*)
166
167 declare noalias i8* @_d_allocclass(%object.ClassInfo*)
168
169 declare i8* @_d_assert_msg(%"byte[]", %"byte[]", i32)
170
171 declare void @_d_invariant(%object.Object*)
172
173 declare void @_d_switch_error(%"byte[]", i32)
174
175 declare fastcc i32 @_D6object10ModuleInfo7opApplyFDFKC10ModuleInfoZiZi(%"int delegate(ref ModuleInfo)")
176
177 define internal void @_D4test16__moduleinfoCtorZ() {
178 moduleinfoCtorEntry:
179     %current = load %ModuleReference** @_Dmodule_ref        ; <%ModuleReference*> [#uses=1]
180     store %ModuleReference* %current, %ModuleReference** getelementptr (%ModuleReference* @_D4test11__moduleRefZ, i32 0, i32 0)
181     store %ModuleReference* @_D4test11__moduleRefZ, %ModuleReference** @_Dmodule_ref
182     ret void
183 }
Copyright © 2008, LDC Development Team.