1 ; RUN: llc < %s -filetype=obj | llvm-readobj - --codeview | FileCheck %s
2 ; RUN: llc < %s | llvm-mc -filetype=obj --triple=x86_64-windows | llvm-readobj - --codeview | FileCheck %s
3 ; RUN: llc < %s | FileCheck %s --check-prefix=ASM
5 ; C++ source to regenerate:
11 ; static const int sdm = 3;
26 ; struct DerivedClass : Struct, virtual Class {
29 ; struct Class::Nested {
39 ; $ clang t.cpp -S -emit-llvm -g -gcodeview -o t.ll
41 ; CHECK: CodeViewTypes [
42 ; CHECK: Section: .debug$T (8)
44 ; CHECK: ArgList (0x1000) {
45 ; CHECK: TypeLeafKind: LF_ARGLIST (0x1201)
50 ; CHECK: Procedure (0x1001) {
51 ; CHECK: TypeLeafKind: LF_PROCEDURE (0x1008)
52 ; CHECK: ReturnType: void (0x3)
53 ; CHECK: CallingConvention: NearC (0x0)
54 ; CHECK: FunctionOptions [ (0x0)
56 ; CHECK: NumParameters: 0
57 ; CHECK: ArgListType: () (0x1000)
59 ; CHECK: FuncId (0x1002) {
60 ; CHECK: TypeLeafKind: LF_FUNC_ID (0x1601)
61 ; CHECK: ParentScope: 0x0
62 ; CHECK: FunctionType: void () (0x1001)
63 ; CHECK: Name: UseTypes
65 ; CHECK: Struct (0x1003) {
66 ; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505)
67 ; CHECK: MemberCount: 0
68 ; CHECK: Properties [ (0x280)
69 ; CHECK: ForwardReference (0x80)
70 ; CHECK: HasUniqueName (0x200)
72 ; CHECK: FieldList: 0x0
73 ; CHECK: DerivedFrom: 0x0
77 ; CHECK: LinkageName: .?AUStruct@@
79 ; CHECK: Modifier (0x1004) {
80 ; CHECK: TypeLeafKind: LF_MODIFIER (0x1001)
81 ; CHECK: ModifiedType: int (0x74)
82 ; CHECK: Modifiers [ (0x1)
86 ; CHECK: FieldList (0x1005) {
87 ; CHECK: TypeLeafKind: LF_FIELDLIST (0x1203)
89 ; CHECK: AccessSpecifier: Public (0x3)
90 ; CHECK: Type: int (0x74)
91 ; CHECK: FieldOffset: 0x0
95 ; CHECK: AccessSpecifier: Public (0x3)
96 ; CHECK: Type: int (0x74)
97 ; CHECK: FieldOffset: 0x4
100 ; CHECK: DataMember {
101 ; CHECK: AccessSpecifier: Public (0x3)
102 ; CHECK: Type: int (0x74)
103 ; CHECK: FieldOffset: 0x8
106 ; CHECK: StaticDataMember {
107 ; CHECK: AccessSpecifier: Public (0x3)
108 ; CHECK: Type: const int (0x1004)
112 ; CHECK: Struct (0x1006) {
113 ; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505)
114 ; CHECK: MemberCount: 4
115 ; CHECK: Properties [ (0x200)
116 ; CHECK: HasUniqueName (0x200)
118 ; CHECK: FieldList: <field list> (0x1005)
119 ; CHECK: DerivedFrom: 0x0
122 ; CHECK: Name: Struct
123 ; CHECK: LinkageName: .?AUStruct@@
125 ; CHECK: StringId (0x1007) {
126 ; CHECK: TypeLeafKind: LF_STRING_ID (0x1605)
128 ; CHECK: StringData: D:\src\llvm\build\t.cpp
130 ; CHECK: UdtSourceLine (0x1008) {
131 ; CHECK: TypeLeafKind: LF_UDT_SRC_LINE (0x1606)
132 ; CHECK: UDT: Struct (0x1006)
133 ; CHECK: SourceFile: D:\src\llvm\build\t.cpp (0x1007)
134 ; CHECK: LineNumber: 1
136 ; CHECK: Union (0x1009) {
137 ; CHECK: TypeLeafKind: LF_UNION (0x1506)
138 ; CHECK: MemberCount: 0
139 ; CHECK: Properties [ (0x280)
140 ; CHECK: ForwardReference (0x80)
141 ; CHECK: HasUniqueName (0x200)
143 ; CHECK: FieldList: 0x0
146 ; CHECK: LinkageName: .?ATUnion@@
148 ; CHECK: FieldList (0x100A) {
149 ; CHECK: TypeLeafKind: LF_FIELDLIST (0x1203)
150 ; CHECK: DataMember {
151 ; CHECK: AccessSpecifier: Public (0x3)
152 ; CHECK: Type: int (0x74)
153 ; CHECK: FieldOffset: 0x0
156 ; CHECK: DataMember {
157 ; CHECK: AccessSpecifier: Public (0x3)
158 ; CHECK: Type: float (0x40)
159 ; CHECK: FieldOffset: 0x0
163 ; CHECK: Union (0x100B) {
164 ; CHECK: TypeLeafKind: LF_UNION (0x1506)
165 ; CHECK: MemberCount: 2
166 ; CHECK: Properties [ (0x600)
167 ; CHECK: HasUniqueName (0x200)
168 ; CHECK: Sealed (0x400)
170 ; CHECK: FieldList: <field list> (0x100A)
173 ; CHECK: LinkageName: .?ATUnion@@
175 ; CHECK: UdtSourceLine (0x100C) {
176 ; CHECK: TypeLeafKind: LF_UDT_SRC_LINE (0x1606)
177 ; CHECK: UDT: Union (0x100B)
178 ; CHECK: SourceFile: D:\src\llvm\build\t.cpp (0x1007)
179 ; CHECK: LineNumber: 7
181 ; CHECK: Class (0x100D) {
182 ; CHECK: TypeLeafKind: LF_CLASS (0x1504)
183 ; CHECK: MemberCount: 0
184 ; CHECK: Properties [ (0x280)
185 ; CHECK: ForwardReference (0x80)
186 ; CHECK: HasUniqueName (0x200)
188 ; CHECK: FieldList: 0x0
189 ; CHECK: DerivedFrom: 0x0
193 ; CHECK: LinkageName: .?AVClass@@
195 ; CHECK: FieldList (0x100E) {
196 ; CHECK: TypeLeafKind: LF_FIELDLIST (0x1203)
197 ; CHECK: DataMember {
198 ; CHECK: AccessSpecifier: Public (0x3)
199 ; CHECK: Type: int (0x74)
200 ; CHECK: FieldOffset: 0x0
203 ; CHECK: DataMember {
204 ; CHECK: AccessSpecifier: Private (0x1)
205 ; CHECK: Type: int (0x74)
206 ; CHECK: FieldOffset: 0x4
209 ; CHECK: DataMember {
210 ; CHECK: AccessSpecifier: Protected (0x2)
211 ; CHECK: Type: int (0x74)
212 ; CHECK: FieldOffset: 0x8
216 ; CHECK: Class (0x100F) {
217 ; CHECK: TypeLeafKind: LF_CLASS (0x1504)
218 ; CHECK: MemberCount: 3
219 ; CHECK: Properties [ (0x200)
220 ; CHECK: HasUniqueName (0x200)
222 ; CHECK: FieldList: <field list> (0x100E)
223 ; CHECK: DerivedFrom: 0x0
227 ; CHECK: LinkageName: .?AVClass@@
229 ; CHECK: UdtSourceLine (0x1010) {
230 ; CHECK: TypeLeafKind: LF_UDT_SRC_LINE (0x1606)
231 ; CHECK: UDT: Class (0x100F)
232 ; CHECK: SourceFile: D:\src\llvm\build\t.cpp (0x1007)
233 ; CHECK: LineNumber: 11
235 ; CHECK: Struct (0x1011) {
236 ; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505)
237 ; CHECK: MemberCount: 0
238 ; CHECK: Properties [ (0x280)
239 ; CHECK: ForwardReference (0x80)
240 ; CHECK: HasUniqueName (0x200)
242 ; CHECK: FieldList: 0x0
243 ; CHECK: DerivedFrom: 0x0
246 ; CHECK: Name: DerivedClass
247 ; CHECK: LinkageName: .?AUDerivedClass@@
249 ; CHECK: Pointer (0x1012) {
250 ; CHECK: TypeLeafKind: LF_POINTER (0x1002)
251 ; CHECK: PointeeType: const int (0x1004)
252 ; CHECK: PtrType: Near64 (0xC)
253 ; CHECK: PtrMode: Pointer (0x0)
256 ; CHECK: IsVolatile: 0
257 ; CHECK: IsUnaligned: 0
260 ; CHECK: VFTableShape (0x1013) {
261 ; CHECK: TypeLeafKind: LF_VTSHAPE (0xA)
262 ; CHECK: VFEntryCount: 1
264 ; CHECK: Pointer (0x1014) {
265 ; CHECK: TypeLeafKind: LF_POINTER (0x1002)
266 ; CHECK: PointeeType: <vftable 1 methods> (0x1013)
267 ; CHECK: PtrType: Near64 (0xC)
268 ; CHECK: PtrMode: Pointer (0x0)
271 ; CHECK: IsVolatile: 0
272 ; CHECK: IsUnaligned: 0
275 ; CHECK: FieldList (0x1015) {
276 ; CHECK: TypeLeafKind: LF_FIELDLIST (0x1203)
278 ; CHECK: AccessSpecifier: Public (0x3)
279 ; CHECK: BaseType: Struct (0x1003)
280 ; CHECK: BaseOffset: 0x0
282 ; CHECK: VirtualBaseClass {
283 ; CHECK: AccessSpecifier: Public (0x3)
284 ; CHECK: BaseType: Class (0x100D)
285 ; CHECK: VBPtrType: const int* (0x1012)
286 ; CHECK: VBPtrOffset: 0x0
287 ; CHECK: VBTableIndex: 0x1
290 ; CHECK: Type: <vftable 1 methods>* (0x1014)
292 ; CHECK: DataMember {
293 ; CHECK: AccessSpecifier: Public (0x3)
294 ; CHECK: Type: int (0x74)
295 ; CHECK: FieldOffset: 0x18
299 ; CHECK: Struct (0x1016) {
300 ; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505)
301 ; CHECK: MemberCount: 4
302 ; CHECK: Properties [ (0x200)
303 ; CHECK: HasUniqueName (0x200)
305 ; CHECK: FieldList: <field list> (0x1015)
306 ; CHECK: DerivedFrom: 0x0
309 ; CHECK: Name: DerivedClass
310 ; CHECK: LinkageName: .?AUDerivedClass@@
312 ; CHECK: UdtSourceLine (0x1017) {
313 ; CHECK: TypeLeafKind: LF_UDT_SRC_LINE (0x1606)
314 ; CHECK: UDT: DerivedClass (0x1016)
315 ; CHECK: SourceFile: D:\src\llvm\build\t.cpp (0x1007)
316 ; CHECK: LineNumber: 20
318 ; CHECK: Struct (0x1018) {
319 ; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505)
320 ; CHECK: MemberCount: 0
321 ; CHECK: Properties [ (0x288)
322 ; CHECK: ForwardReference (0x80)
323 ; CHECK: HasUniqueName (0x200)
324 ; CHECK: Nested (0x8)
326 ; CHECK: FieldList: 0x0
327 ; CHECK: DerivedFrom: 0x0
330 ; CHECK: Name: Class::Nested
331 ; CHECK: LinkageName: .?AUNested@Class@@
333 ; CHECK: FieldList (0x1019) {
334 ; CHECK: TypeLeafKind: LF_FIELDLIST (0x1203)
335 ; CHECK: DataMember {
336 ; CHECK: AccessSpecifier: Public (0x3)
337 ; CHECK: Type: int (0x74)
338 ; CHECK: FieldOffset: 0x0
342 ; CHECK: Struct (0x101A) {
343 ; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505)
344 ; CHECK: MemberCount: 1
345 ; CHECK: Properties [ (0x208)
346 ; CHECK: HasUniqueName (0x200)
347 ; CHECK: Nested (0x8)
349 ; CHECK: FieldList: <field list> (0x1019)
350 ; CHECK: DerivedFrom: 0x0
353 ; CHECK: Name: Class::Nested
354 ; CHECK: LinkageName: .?AUNested@Class@@
356 ; CHECK: UdtSourceLine (0x101B) {
357 ; CHECK: TypeLeafKind: LF_UDT_SRC_LINE (0x1606)
358 ; CHECK: UDT: Class::Nested (0x101A)
359 ; CHECK: SourceFile: D:\src\llvm\build\t.cpp (0x1007)
360 ; CHECK: LineNumber: 23
362 ; CHECK: Pointer (0x101C) {
363 ; CHECK: TypeLeafKind: LF_POINTER (0x1002)
364 ; CHECK: PointeeType: DerivedClass (0x1011)
365 ; CHECK: PtrType: Near64 (0xC)
366 ; CHECK: PtrMode: Pointer (0x0)
369 ; CHECK: IsVolatile: 0
370 ; CHECK: IsUnaligned: 0
373 ; CHECK: MemberFunction (0x101D) {
374 ; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009)
375 ; CHECK: ReturnType: void (0x3)
376 ; CHECK: ClassType: DerivedClass (0x1011)
377 ; CHECK: ThisType: DerivedClass* const (0x101C)
378 ; CHECK: CallingConvention: NearC (0x0)
379 ; CHECK: FunctionOptions [ (0x0)
381 ; CHECK: NumParameters: 0
382 ; CHECK: ArgListType: () (0x1000)
383 ; CHECK: ThisAdjustment: 0
385 ; CHECK: MemberFuncId (0x101E) {
386 ; CHECK: TypeLeafKind: LF_MFUNC_ID (0x1602)
387 ; CHECK: ClassType: DerivedClass (0x1011)
388 ; CHECK: FunctionType: void DerivedClass::() (0x101D)
389 ; CHECK: Name: DerivedClass::DerivedClass
393 ; ASM: .section .debug$T,"dr"
395 ; ASM: .long 4 # Debug section magic
396 ; ASM: # ArgList (0x1000)
397 ; ASM: .short 0x6 # Record length
398 ; ASM: .short 0x1201 # Record kind: LF_ARGLIST
399 ; ASM: .long 0x0 # NumArgs
400 ; ASM: # Procedure (0x1001)
401 ; ASM: .short 0xe # Record length
402 ; ASM: .short 0x1008 # Record kind: LF_PROCEDURE
403 ; ASM: .long 0x3 # ReturnType: void
404 ; ASM: .byte 0x0 # CallingConvention: NearC
405 ; ASM: .byte 0x0 # FunctionOptions
406 ; ASM: .short 0x0 # NumParameters
407 ; ASM: .long 0x1000 # ArgListType: ()
408 ; ASM: # FuncId (0x1002)
409 ; ASM: .short 0x16 # Record length
410 ; ASM: .short 0x1601 # Record kind: LF_FUNC_ID
411 ; ASM: .long 0x0 # ParentScope
412 ; ASM: .long 0x1001 # FunctionType: void ()
413 ; ASM: .asciz "UseTypes" # Name
417 ; ASM: # Struct (0x1003)
418 ; ASM: .short 0x2a # Record length
419 ; ASM: .short 0x1505 # Record kind: LF_STRUCTURE
420 ; ASM: .short 0x0 # MemberCount
421 ; ASM: .short 0x280 # Properties ( ForwardReference (0x80) | HasUniqueName (0x200) )
422 ; ASM: .long 0x0 # FieldList
423 ; ASM: .long 0x0 # DerivedFrom
424 ; ASM: .long 0x0 # VShape
425 ; ASM: .short 0x0 # SizeOf
426 ; ASM: .asciz "Struct" # Name
427 ; ASM: .asciz ".?AUStruct@@" # LinkageName
430 ; ASM: # Modifier (0x1004)
431 ; ASM: .short 0xa # Record length
432 ; ASM: .short 0x1001 # Record kind: LF_MODIFIER
433 ; ASM: .long 0x74 # ModifiedType: int
434 ; ASM: .short 0x1 # Modifiers ( Const (0x1) )
437 ; ASM: # FieldList (0x1005)
438 ; ASM: .short 0x3e # Record length
439 ; ASM: .short 0x1203 # Record kind: LF_FIELDLIST
440 ; ASM: .short 0x150d # Member kind: DataMember ( LF_MEMBER )
441 ; ASM: .short 0x3 # Attrs: Public
442 ; ASM: .long 0x74 # Type: int
443 ; ASM: .short 0x0 # FieldOffset
444 ; ASM: .asciz "s1" # Name
448 ; ASM: .short 0x150d # Member kind: DataMember ( LF_MEMBER )
449 ; ASM: .short 0x3 # Attrs: Public
450 ; ASM: .long 0x74 # Type: int
451 ; ASM: .short 0x4 # FieldOffset
452 ; ASM: .asciz "s2" # Name
456 ; ASM: .short 0x150d # Member kind: DataMember ( LF_MEMBER )
457 ; ASM: .short 0x3 # Attrs: Public
458 ; ASM: .long 0x74 # Type: int
459 ; ASM: .short 0x8 # FieldOffset
460 ; ASM: .asciz "s3" # Name
464 ; ASM: .short 0x150e # Member kind: StaticDataMember ( LF_STMEMBER )
465 ; ASM: .short 0x3 # Attrs: Public
466 ; ASM: .long 0x1004 # Type: const int
467 ; ASM: .asciz "sdm" # Name
468 ; ASM: # Struct (0x1006)
469 ; ASM: .short 0x2a # Record length
470 ; ASM: .short 0x1505 # Record kind: LF_STRUCTURE
471 ; ASM: .short 0x4 # MemberCount
472 ; ASM: .short 0x200 # Properties ( HasUniqueName (0x200) )
473 ; ASM: .long 0x1005 # FieldList: <field list>
474 ; ASM: .long 0x0 # DerivedFrom
475 ; ASM: .long 0x0 # VShape
476 ; ASM: .short 0xc # SizeOf
477 ; ASM: .asciz "Struct" # Name
478 ; ASM: .asciz ".?AUStruct@@" # LinkageName
481 ; ASM: # StringId (0x1007)
482 ; ASM: .short 0x1e # Record length
483 ; ASM: .short 0x1605 # Record kind: LF_STRING_ID
484 ; ASM: .long 0x0 # Id
485 ; ASM: .asciz "D:\\src\\llvm\\build\\t.cpp" # StringData
486 ; ASM: # UdtSourceLine (0x1008)
487 ; ASM: .short 0xe # Record length
488 ; ASM: .short 0x1606 # Record kind: LF_UDT_SRC_LINE
489 ; ASM: .long 0x1006 # UDT: Struct
490 ; ASM: .long 0x1007 # SourceFile: D:\src\llvm\build\t.cpp
491 ; ASM: .long 0x1 # LineNumber
492 ; ASM: # Union (0x1009)
493 ; ASM: .short 0x1e # Record length
494 ; ASM: .short 0x1506 # Record kind: LF_UNION
495 ; ASM: .short 0x0 # MemberCount
496 ; ASM: .short 0x280 # Properties ( ForwardReference (0x80) | HasUniqueName (0x200) )
497 ; ASM: .long 0x0 # FieldList
498 ; ASM: .short 0x0 # SizeOf
499 ; ASM: .asciz "Union" # Name
500 ; ASM: .asciz ".?ATUnion@@" # LinkageName
501 ; ASM: # FieldList (0x100A)
502 ; ASM: .short 0x1a # Record length
503 ; ASM: .short 0x1203 # Record kind: LF_FIELDLIST
504 ; ASM: .short 0x150d # Member kind: DataMember ( LF_MEMBER )
505 ; ASM: .short 0x3 # Attrs: Public
506 ; ASM: .long 0x74 # Type: int
507 ; ASM: .short 0x0 # FieldOffset
508 ; ASM: .asciz "a" # Name
509 ; ASM: .short 0x150d # Member kind: DataMember ( LF_MEMBER )
510 ; ASM: .short 0x3 # Attrs: Public
511 ; ASM: .long 0x40 # Type: float
512 ; ASM: .short 0x0 # FieldOffset
513 ; ASM: .asciz "b" # Name
514 ; ASM: # Union (0x100B)
515 ; ASM: .short 0x1e # Record length
516 ; ASM: .short 0x1506 # Record kind: LF_UNION
517 ; ASM: .short 0x2 # MemberCount
518 ; ASM: .short 0x600 # Properties ( HasUniqueName (0x200) | Sealed (0x400) )
519 ; ASM: .long 0x100a # FieldList: <field list>
520 ; ASM: .short 0x4 # SizeOf
521 ; ASM: .asciz "Union" # Name
522 ; ASM: .asciz ".?ATUnion@@" # LinkageName
523 ; ASM: # UdtSourceLine (0x100C)
524 ; ASM: .short 0xe # Record length
525 ; ASM: .short 0x1606 # Record kind: LF_UDT_SRC_LINE
526 ; ASM: .long 0x100b # UDT: Union
527 ; ASM: .long 0x1007 # SourceFile: D:\src\llvm\build\t.cpp
528 ; ASM: .long 0x7 # LineNumber
529 ; ASM: # Class (0x100D)
530 ; ASM: .short 0x26 # Record length
531 ; ASM: .short 0x1504 # Record kind: LF_CLASS
532 ; ASM: .short 0x0 # MemberCount
533 ; ASM: .short 0x280 # Properties ( ForwardReference (0x80) | HasUniqueName (0x200) )
534 ; ASM: .long 0x0 # FieldList
535 ; ASM: .long 0x0 # DerivedFrom
536 ; ASM: .long 0x0 # VShape
537 ; ASM: .short 0x0 # SizeOf
538 ; ASM: .asciz "Class" # Name
539 ; ASM: .asciz ".?AVClass@@" # LinkageName
540 ; ASM: # FieldList (0x100E)
541 ; ASM: .short 0x32 # Record length
542 ; ASM: .short 0x1203 # Record kind: LF_FIELDLIST
543 ; ASM: .short 0x150d # Member kind: DataMember ( LF_MEMBER )
544 ; ASM: .short 0x3 # Attrs: Public
545 ; ASM: .long 0x74 # Type: int
546 ; ASM: .short 0x0 # FieldOffset
547 ; ASM: .asciz "pub" # Name
550 ; ASM: .short 0x150d # Member kind: DataMember ( LF_MEMBER )
551 ; ASM: .short 0x1 # Attrs: Private
552 ; ASM: .long 0x74 # Type: int
553 ; ASM: .short 0x4 # FieldOffset
554 ; ASM: .asciz "priv" # Name
556 ; ASM: .short 0x150d # Member kind: DataMember ( LF_MEMBER )
557 ; ASM: .short 0x2 # Attrs: Protected
558 ; ASM: .long 0x74 # Type: int
559 ; ASM: .short 0x8 # FieldOffset
560 ; ASM: .asciz "prot" # Name
562 ; ASM: # Class (0x100F)
563 ; ASM: .short 0x26 # Record length
564 ; ASM: .short 0x1504 # Record kind: LF_CLASS
565 ; ASM: .short 0x3 # MemberCount
566 ; ASM: .short 0x200 # Properties ( HasUniqueName (0x200) )
567 ; ASM: .long 0x100e # FieldList: <field list>
568 ; ASM: .long 0x0 # DerivedFrom
569 ; ASM: .long 0x0 # VShape
570 ; ASM: .short 0xc # SizeOf
571 ; ASM: .asciz "Class" # Name
572 ; ASM: .asciz ".?AVClass@@" # LinkageName
573 ; ASM: # UdtSourceLine (0x1010)
574 ; ASM: .short 0xe # Record length
575 ; ASM: .short 0x1606 # Record kind: LF_UDT_SRC_LINE
576 ; ASM: .long 0x100f # UDT: Class
577 ; ASM: .long 0x1007 # SourceFile: D:\src\llvm\build\t.cpp
578 ; ASM: .long 0xb # LineNumber
579 ; ASM: # Struct (0x1011)
580 ; ASM: .short 0x36 # Record length
581 ; ASM: .short 0x1505 # Record kind: LF_STRUCTURE
582 ; ASM: .short 0x0 # MemberCount
583 ; ASM: .short 0x280 # Properties ( ForwardReference (0x80) | HasUniqueName (0x200) )
584 ; ASM: .long 0x0 # FieldList
585 ; ASM: .long 0x0 # DerivedFrom
586 ; ASM: .long 0x0 # VShape
587 ; ASM: .short 0x0 # SizeOf
588 ; ASM: .asciz "DerivedClass" # Name
589 ; ASM: .asciz ".?AUDerivedClass@@" # LinkageName
592 ; ASM: # Pointer (0x1012)
593 ; ASM: .short 0xa # Record length
594 ; ASM: .short 0x1002 # Record kind: LF_POINTER
595 ; ASM: .long 0x1004 # PointeeType: const int
596 ; ASM: .long 0x1000c # Attrs: [ Type: Near64, Mode: Pointer, SizeOf: 8 ]
597 ; ASM: # VFTableShape (0x1013)
598 ; ASM: .short 0x6 # Record length
599 ; ASM: .short 0xa # Record kind: LF_VTSHAPE
600 ; ASM: .short 0x1 # VFEntryCount
603 ; ASM: # Pointer (0x1014)
604 ; ASM: .short 0xa # Record length
605 ; ASM: .short 0x1002 # Record kind: LF_POINTER
606 ; ASM: .long 0x1013 # PointeeType: <vftable 1 methods>
607 ; ASM: .long 0x1000c # Attrs: [ Type: Near64, Mode: Pointer, SizeOf: 8 ]
608 ; ASM: # FieldList (0x1015)
609 ; ASM: .short 0x32 # Record length
610 ; ASM: .short 0x1203 # Record kind: LF_FIELDLIST
611 ; ASM: .short 0x1400 # Member kind: BaseClass ( LF_BCLASS )
612 ; ASM: .short 0x3 # Attrs: Public
613 ; ASM: .long 0x1003 # BaseType: Struct
614 ; ASM: .short 0x0 # BaseOffset
617 ; ASM: .short 0x1401 # Member kind: VirtualBaseClass ( LF_VBCLASS )
618 ; ASM: .short 0x3 # Attrs: Public
619 ; ASM: .long 0x100d # BaseType: Class
620 ; ASM: .long 0x1012 # VBPtrType: const int*
621 ; ASM: .short 0x0 # VBPtrOffset
622 ; ASM: .short 0x1 # VBTableIndex
623 ; ASM: .short 0x1409 # Member kind: VFPtr ( LF_VFUNCTAB )
624 ; ASM: .short 0x0 # Padding
625 ; ASM: .long 0x1014 # Type: <vftable 1 methods>*
626 ; ASM: .short 0x150d # Member kind: DataMember ( LF_MEMBER )
627 ; ASM: .short 0x3 # Attrs: Public
628 ; ASM: .long 0x74 # Type: int
629 ; ASM: .short 0x18 # FieldOffset
630 ; ASM: .asciz "d" # Name
631 ; ASM: # Struct (0x1016)
632 ; ASM: .short 0x36 # Record length
633 ; ASM: .short 0x1505 # Record kind: LF_STRUCTURE
634 ; ASM: .short 0x4 # MemberCount
635 ; ASM: .short 0x200 # Properties ( HasUniqueName (0x200) )
636 ; ASM: .long 0x1015 # FieldList: <field list>
637 ; ASM: .long 0x0 # DerivedFrom
638 ; ASM: .long 0x0 # VShape
639 ; ASM: .short 0x30 # SizeOf
640 ; ASM: .asciz "DerivedClass" # Name
641 ; ASM: .asciz ".?AUDerivedClass@@" # LinkageName
644 ; ASM: # UdtSourceLine (0x1017)
645 ; ASM: .short 0xe # Record length
646 ; ASM: .short 0x1606 # Record kind: LF_UDT_SRC_LINE
647 ; ASM: .long 0x1016 # UDT: DerivedClass
648 ; ASM: .long 0x1007 # SourceFile: D:\src\llvm\build\t.cpp
649 ; ASM: .long 0x14 # LineNumber
650 ; ASM: # Struct (0x1018)
651 ; ASM: .short 0x36 # Record length
652 ; ASM: .short 0x1505 # Record kind: LF_STRUCTURE
653 ; ASM: .short 0x0 # MemberCount
654 ; ASM: .short 0x288 # Properties ( ForwardReference (0x80) | HasUniqueName (0x200) | Nested (0x8) )
655 ; ASM: .long 0x0 # FieldList
656 ; ASM: .long 0x0 # DerivedFrom
657 ; ASM: .long 0x0 # VShape
658 ; ASM: .short 0x0 # SizeOf
659 ; ASM: .asciz "Class::Nested" # Name
660 ; ASM: .asciz ".?AUNested@Class@@" # LinkageName
662 ; ASM: # FieldList (0x1019)
663 ; ASM: .short 0xe # Record length
664 ; ASM: .short 0x1203 # Record kind: LF_FIELDLIST
665 ; ASM: .short 0x150d # Member kind: DataMember ( LF_MEMBER )
666 ; ASM: .short 0x3 # Attrs: Public
667 ; ASM: .long 0x74 # Type: int
668 ; ASM: .short 0x0 # FieldOffset
669 ; ASM: .asciz "n" # Name
670 ; ASM: # Struct (0x101A)
671 ; ASM: .short 0x36 # Record length
672 ; ASM: .short 0x1505 # Record kind: LF_STRUCTURE
673 ; ASM: .short 0x1 # MemberCount
674 ; ASM: .short 0x208 # Properties ( HasUniqueName (0x200) | Nested (0x8) )
675 ; ASM: .long 0x1019 # FieldList: <field list>
676 ; ASM: .long 0x0 # DerivedFrom
677 ; ASM: .long 0x0 # VShape
678 ; ASM: .short 0x4 # SizeOf
679 ; ASM: .asciz "Class::Nested" # Name
680 ; ASM: .asciz ".?AUNested@Class@@" # LinkageName
682 ; ASM: # UdtSourceLine (0x101B)
683 ; ASM: .short 0xe # Record length
684 ; ASM: .short 0x1606 # Record kind: LF_UDT_SRC_LINE
685 ; ASM: .long 0x101a # UDT: Class::Nested
686 ; ASM: .long 0x1007 # SourceFile: D:\src\llvm\build\t.cpp
687 ; ASM: .long 0x17 # LineNumber
688 ; ASM: # Pointer (0x101C)
689 ; ASM: .short 0xa # Record length
690 ; ASM: .short 0x1002 # Record kind: LF_POINTER
691 ; ASM: .long 0x1011 # PointeeType: DerivedClass
692 ; ASM: .long 0x1040c # Attrs: [ Type: Near64, Mode: Pointer, SizeOf: 8, isConst ]
693 ; ASM: # MemberFunction (0x101D)
694 ; ASM: .short 0x1a # Record length
695 ; ASM: .short 0x1009 # Record kind: LF_MFUNCTION
696 ; ASM: .long 0x3 # ReturnType: void
697 ; ASM: .long 0x1011 # ClassType: DerivedClass
698 ; ASM: .long 0x101c # ThisType: DerivedClass* const
699 ; ASM: .byte 0x0 # CallingConvention: NearC
700 ; ASM: .byte 0x0 # FunctionOptions
701 ; ASM: .short 0x0 # NumParameters
702 ; ASM: .long 0x1000 # ArgListType: ()
703 ; ASM: .long 0x0 # ThisAdjustment
704 ; ASM: # MemberFuncId (0x101E)
705 ; ASM: .short 0x26 # Record length
706 ; ASM: .short 0x1602 # Record kind: LF_MFUNC_ID
707 ; ASM: .long 0x1011 # ClassType: DerivedClass
708 ; ASM: .long 0x101d # FunctionType: void DerivedClass::()
709 ; ASM: .asciz "DerivedClass::DerivedClass" # Name
711 ; ASM: # Pointer (0x101F)
712 ; ASM: .short 0xa # Record length
713 ; ASM: .short 0x1002 # Record kind: LF_POINTER
714 ; ASM: .long 0x1011 # PointeeType: DerivedClass
715 ; ASM: .long 0x1000c # Attrs: [ Type: Near64, Mode: Pointer, SizeOf: 8 ]
716 ; ASM: # StringId (0x1020)
717 ; ASM: .short 0x1a # Record length
718 ; ASM: .short 0x1605 # Record kind: LF_STRING_ID
719 ; ASM: .long 0x0 # Id
720 ; ASM: .asciz "D:\\src\\llvm\\build" # StringData
723 ; ASM: # StringId (0x1021)
724 ; ASM: .short 0xe # Record length
725 ; ASM: .short 0x1605 # Record kind: LF_STRING_ID
726 ; ASM: .long 0x0 # Id
727 ; ASM: .asciz "t.cpp" # StringData
730 ; ASM: # BuildInfo (0x1022)
731 ; ASM: .short 0x1a # Record length
732 ; ASM: .short 0x1603 # Record kind: LF_BUILDINFO
733 ; ASM: .short 0x5 # NumArgs
734 ; ASM: .long 0x1020 # Argument: D:\src\llvm\build
735 ; ASM: .long 0x0 # Argument
736 ; ASM: .long 0x1021 # Argument: t.cpp
737 ; ASM: .long 0x0 # Argument
738 ; ASM: .long 0x0 # Argument
743 source_filename = "t.cpp"
744 target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
745 target triple = "x86_64-pc-windows-msvc19.0.23918"
747 %struct.Struct = type { i32, i32, i32 }
748 %union.Union = type { i32 }
749 %class.Class = type { i32, i32, i32 }
750 %struct.DerivedClass = type { %struct.Struct, i32*, i32, [4 x i8], %class.Class }
751 %"struct.Class::Nested" = type { i32 }
753 $"\01??0DerivedClass@@QEAA@XZ" = comdat any
755 $"\01??_8DerivedClass@@7B@" = comdat any
757 @"\01??_8DerivedClass@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 -16, i32 16], comdat
759 ; Function Attrs: nounwind uwtable
760 define void @"\01?UseTypes@@YAXXZ"() #0 !dbg !7 {
762 %s = alloca %struct.Struct, align 4
763 %u = alloca %union.Union, align 4
764 %c = alloca %class.Class, align 4
765 %dc = alloca %struct.DerivedClass, align 8
766 %n = alloca %"struct.Class::Nested", align 4
767 call void @llvm.dbg.declare(metadata %struct.Struct* %s, metadata !10, metadata !19), !dbg !20
768 call void @llvm.dbg.declare(metadata %union.Union* %u, metadata !21, metadata !19), !dbg !27
769 call void @llvm.dbg.declare(metadata %class.Class* %c, metadata !28, metadata !19), !dbg !34
770 call void @llvm.dbg.declare(metadata %struct.DerivedClass* %dc, metadata !35, metadata !19), !dbg !46
771 %call = call %struct.DerivedClass* @"\01??0DerivedClass@@QEAA@XZ"(%struct.DerivedClass* %dc, i32 1) #3, !dbg !46
772 call void @llvm.dbg.declare(metadata %"struct.Class::Nested"* %n, metadata !47, metadata !19), !dbg !51
776 ; Function Attrs: nounwind readnone
777 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
779 ; Function Attrs: inlinehint nounwind uwtable
780 define linkonce_odr %struct.DerivedClass* @"\01??0DerivedClass@@QEAA@XZ"(%struct.DerivedClass* returned %this, i32 %is_most_derived) unnamed_addr #2 comdat align 2 !dbg !53 {
782 %retval = alloca %struct.DerivedClass*, align 8
783 %is_most_derived.addr = alloca i32, align 4
784 %this.addr = alloca %struct.DerivedClass*, align 8
785 store i32 %is_most_derived, i32* %is_most_derived.addr, align 4
786 call void @llvm.dbg.declare(metadata i32* %is_most_derived.addr, metadata !58, metadata !19), !dbg !59
787 store %struct.DerivedClass* %this, %struct.DerivedClass** %this.addr, align 8
788 call void @llvm.dbg.declare(metadata %struct.DerivedClass** %this.addr, metadata !60, metadata !19), !dbg !59
789 %this1 = load %struct.DerivedClass*, %struct.DerivedClass** %this.addr, align 8
790 store %struct.DerivedClass* %this1, %struct.DerivedClass** %retval, align 8
791 %is_most_derived2 = load i32, i32* %is_most_derived.addr, align 4
792 %is_complete_object = icmp ne i32 %is_most_derived2, 0, !dbg !62
793 br i1 %is_complete_object, label %ctor.init_vbases, label %ctor.skip_vbases, !dbg !62
795 ctor.init_vbases: ; preds = %entry
796 %this.int8 = bitcast %struct.DerivedClass* %this1 to i8*, !dbg !62
797 %0 = getelementptr inbounds i8, i8* %this.int8, i64 16, !dbg !62
798 %vbptr.DerivedClass = bitcast i8* %0 to i32**, !dbg !62
799 store i32* getelementptr inbounds ([2 x i32], [2 x i32]* @"\01??_8DerivedClass@@7B@", i32 0, i32 0), i32** %vbptr.DerivedClass, align 8, !dbg !62
800 %1 = bitcast %struct.DerivedClass* %this1 to i8*, !dbg !62
801 %2 = getelementptr inbounds i8, i8* %1, i64 32, !dbg !62
802 %3 = bitcast i8* %2 to %class.Class*, !dbg !62
803 br label %ctor.skip_vbases, !dbg !62
805 ctor.skip_vbases: ; preds = %ctor.init_vbases, %entry
806 %4 = bitcast %struct.DerivedClass* %this1 to %struct.Struct*, !dbg !62
807 %5 = load %struct.DerivedClass*, %struct.DerivedClass** %retval, align 8, !dbg !62
808 ret %struct.DerivedClass* %5, !dbg !62
811 attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-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" }
812 attributes #1 = { nounwind readnone }
813 attributes #2 = { inlinehint nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="false" "no-jump-tables"="false" "no-nans-fp-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" }
814 attributes #3 = { nounwind }
817 !llvm.module.flags = !{!3, !4, !5}
820 !0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 3.9.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2)
821 !1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild")
823 !3 = !{i32 2, !"CodeView", i32 1}
824 !4 = !{i32 2, !"Debug Info Version", i32 3}
825 !5 = !{i32 1, !"PIC Level", i32 2}
826 !6 = !{!"clang version 3.9.0 "}
827 !7 = distinct !DISubprogram(name: "UseTypes", linkageName: "\01?UseTypes@@YAXXZ", scope: !1, file: !1, line: 26, type: !8, isLocal: false, isDefinition: true, scopeLine: 26, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
828 !8 = !DISubroutineType(types: !9)
830 !10 = !DILocalVariable(name: "s", scope: !7, file: !1, line: 27, type: !11)
831 !11 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Struct", file: !1, line: 1, size: 96, align: 32, elements: !12, identifier: ".?AUStruct@@")
832 !12 = !{!13, !15, !16, !17}
833 !13 = !DIDerivedType(tag: DW_TAG_member, name: "s1", scope: !11, file: !1, line: 2, baseType: !14, size: 32, align: 32)
834 !14 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed)
835 !15 = !DIDerivedType(tag: DW_TAG_member, name: "s2", scope: !11, file: !1, line: 3, baseType: !14, size: 32, align: 32, offset: 32)
836 !16 = !DIDerivedType(tag: DW_TAG_member, name: "s3", scope: !11, file: !1, line: 4, baseType: !14, size: 32, align: 32, offset: 64)
837 !17 = !DIDerivedType(tag: DW_TAG_member, name: "sdm", scope: !11, file: !1, line: 5, baseType: !18, flags: DIFlagStaticMember, extraData: i32 3)
838 !18 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !14)
839 !19 = !DIExpression()
840 !20 = !DILocation(line: 27, column: 10, scope: !7)
841 !21 = !DILocalVariable(name: "u", scope: !7, file: !1, line: 28, type: !22)
842 !22 = distinct !DICompositeType(tag: DW_TAG_union_type, name: "Union", file: !1, line: 7, size: 32, align: 32, elements: !23, identifier: ".?ATUnion@@")
844 !24 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !22, file: !1, line: 8, baseType: !14, size: 32, align: 32)
845 !25 = !DIDerivedType(tag: DW_TAG_member, name: "b", scope: !22, file: !1, line: 9, baseType: !26, size: 32, align: 32)
846 !26 = !DIBasicType(name: "float", size: 32, align: 32, encoding: DW_ATE_float)
847 !27 = !DILocation(line: 28, column: 9, scope: !7)
848 !28 = !DILocalVariable(name: "c", scope: !7, file: !1, line: 29, type: !29)
849 !29 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "Class", file: !1, line: 11, size: 96, align: 32, elements: !30, identifier: ".?AVClass@@")
850 !30 = !{!31, !32, !33}
851 !31 = !DIDerivedType(tag: DW_TAG_member, name: "pub", scope: !29, file: !1, line: 13, baseType: !14, size: 32, align: 32, flags: DIFlagPublic)
852 !32 = !DIDerivedType(tag: DW_TAG_member, name: "priv", scope: !29, file: !1, line: 16, baseType: !14, size: 32, align: 32, offset: 32)
853 !33 = !DIDerivedType(tag: DW_TAG_member, name: "prot", scope: !29, file: !1, line: 18, baseType: !14, size: 32, align: 32, offset: 64, flags: DIFlagProtected)
854 !34 = !DILocation(line: 29, column: 9, scope: !7)
855 !35 = !DILocalVariable(name: "dc", scope: !7, file: !1, line: 30, type: !36)
856 !36 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "DerivedClass", file: !1, line: 20, size: 384, align: 64, elements: !37, vtableHolder: !36, identifier: ".?AUDerivedClass@@")
857 !37 = !{!38, !39, !40, !45}
858 !38 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !36, baseType: !11)
859 !39 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !36, baseType: !29, offset: 4, flags: DIFlagVirtual)
860 !40 = !DIDerivedType(tag: DW_TAG_member, name: "_vptr$DerivedClass", scope: !1, file: !1, baseType: !41, size: 64, flags: DIFlagArtificial)
861 !41 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !42, size: 64)
862 !42 = !DIDerivedType(tag: DW_TAG_pointer_type, name: "__vtbl_ptr_type", baseType: !43, size: 64)
863 !43 = !DISubroutineType(types: !44)
865 !45 = !DIDerivedType(tag: DW_TAG_member, name: "d", scope: !36, file: !1, line: 21, baseType: !14, size: 32, align: 32, offset: 192)
866 !46 = !DILocation(line: 30, column: 16, scope: !7)
867 !47 = !DILocalVariable(name: "n", scope: !7, file: !1, line: 31, type: !48)
868 !48 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Nested", scope: !29, file: !1, line: 23, size: 32, align: 32, elements: !49, identifier: ".?AUNested@Class@@")
870 !50 = !DIDerivedType(tag: DW_TAG_member, name: "n", scope: !48, file: !1, line: 24, baseType: !14, size: 32, align: 32)
871 !51 = !DILocation(line: 31, column: 17, scope: !7)
872 !52 = !DILocation(line: 32, column: 1, scope: !7)
873 !53 = distinct !DISubprogram(name: "DerivedClass::DerivedClass", linkageName: "\01??0DerivedClass@@QEAA@XZ", scope: !36, file: !1, line: 20, type: !54, isLocal: false, isDefinition: true, scopeLine: 20, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false, unit: !0, declaration: !57, retainedNodes: !2)
874 !54 = !DISubroutineType(types: !55)
876 !56 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !36, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
877 !57 = !DISubprogram(name: "DerivedClass::DerivedClass", scope: !36, type: !54, isLocal: false, isDefinition: false, flags: DIFlagArtificial | DIFlagPrototyped, isOptimized: false)
878 !58 = !DILocalVariable(name: "is_most_derived", arg: 2, scope: !53, type: !14, flags: DIFlagArtificial)
879 !59 = !DILocation(line: 0, scope: !53)
880 !60 = !DILocalVariable(name: "this", arg: 1, scope: !53, type: !61, flags: DIFlagArtificial | DIFlagObjectPointer)
881 !61 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !36, size: 64, align: 64)
882 !62 = !DILocation(line: 20, column: 8, scope: !53)