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 4 5; C++ source to regenerate: 6; $ cat t.cpp 7; struct Struct { 8; int s1; 9; int s2; 10; int s3; 11; static const int sdm = 3; 12; }; 13; union Union { 14; int a; 15; float b; 16; }; 17; class Class { 18; public: 19; int pub; 20; struct Nested; 21; private: 22; int priv; 23; protected: 24; int prot; 25; }; 26; struct DerivedClass : Struct, virtual Class { 27; int d; 28; }; 29; struct Class::Nested { 30; int n; 31; }; 32; void UseTypes() { 33; Struct s; 34; Union u; 35; Class c; 36; DerivedClass dc; 37; Class::Nested n; 38; } 39; $ clang t.cpp -S -emit-llvm -g -gcodeview -o t.ll 40 41; CHECK: CodeViewTypes [ 42; CHECK: Section: .debug$T (8) 43; CHECK: Magic: 0x4 44; CHECK: ArgList (0x1000) { 45; CHECK: TypeLeafKind: LF_ARGLIST (0x1201) 46; CHECK: NumArgs: 0 47; CHECK: Arguments [ 48; CHECK: ] 49; CHECK: } 50; CHECK: Procedure (0x1001) { 51; CHECK: TypeLeafKind: LF_PROCEDURE (0x1008) 52; CHECK: ReturnType: void (0x3) 53; CHECK: CallingConvention: NearC (0x0) 54; CHECK: FunctionOptions [ (0x0) 55; CHECK: ] 56; CHECK: NumParameters: 0 57; CHECK: ArgListType: () (0x1000) 58; CHECK: } 59; CHECK: FuncId (0x1002) { 60; CHECK: TypeLeafKind: LF_FUNC_ID (0x1601) 61; CHECK: ParentScope: 0x0 62; CHECK: FunctionType: void () (0x1001) 63; CHECK: Name: UseTypes 64; CHECK: } 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) 71; CHECK: ] 72; CHECK: FieldList: 0x0 73; CHECK: DerivedFrom: 0x0 74; CHECK: VShape: 0x0 75; CHECK: SizeOf: 0 76; CHECK: Name: Struct 77; CHECK: LinkageName: .?AUStruct@@ 78; CHECK: } 79; CHECK: Modifier (0x1004) { 80; CHECK: TypeLeafKind: LF_MODIFIER (0x1001) 81; CHECK: ModifiedType: int (0x74) 82; CHECK: Modifiers [ (0x1) 83; CHECK: Const (0x1) 84; CHECK: ] 85; CHECK: } 86; CHECK: FieldList (0x1005) { 87; CHECK: TypeLeafKind: LF_FIELDLIST (0x1203) 88; CHECK: DataMember { 89; CHECK: AccessSpecifier: Public (0x3) 90; CHECK: Type: int (0x74) 91; CHECK: FieldOffset: 0x0 92; CHECK: Name: s1 93; CHECK: } 94; CHECK: DataMember { 95; CHECK: AccessSpecifier: Public (0x3) 96; CHECK: Type: int (0x74) 97; CHECK: FieldOffset: 0x4 98; CHECK: Name: s2 99; CHECK: } 100; CHECK: DataMember { 101; CHECK: AccessSpecifier: Public (0x3) 102; CHECK: Type: int (0x74) 103; CHECK: FieldOffset: 0x8 104; CHECK: Name: s3 105; CHECK: } 106; CHECK: StaticDataMember { 107; CHECK: AccessSpecifier: Public (0x3) 108; CHECK: Type: const int (0x1004) 109; CHECK: Name: sdm 110; CHECK: } 111; CHECK: } 112; CHECK: Struct (0x1006) { 113; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505) 114; CHECK: MemberCount: 4 115; CHECK: Properties [ (0x200) 116; CHECK: HasUniqueName (0x200) 117; CHECK: ] 118; CHECK: FieldList: <field list> (0x1005) 119; CHECK: DerivedFrom: 0x0 120; CHECK: VShape: 0x0 121; CHECK: SizeOf: 12 122; CHECK: Name: Struct 123; CHECK: LinkageName: .?AUStruct@@ 124; CHECK: } 125; CHECK: StringId (0x1007) { 126; CHECK: TypeLeafKind: LF_STRING_ID (0x1605) 127; CHECK: Id: 0x0 128; CHECK: StringData: D:\src\llvm\build\t.cpp 129; CHECK: } 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 135; CHECK: } 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) 142; CHECK: ] 143; CHECK: FieldList: 0x0 144; CHECK: SizeOf: 0 145; CHECK: Name: Union 146; CHECK: LinkageName: .?ATUnion@@ 147; CHECK: } 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 154; CHECK: Name: a 155; CHECK: } 156; CHECK: DataMember { 157; CHECK: AccessSpecifier: Public (0x3) 158; CHECK: Type: float (0x40) 159; CHECK: FieldOffset: 0x0 160; CHECK: Name: b 161; CHECK: } 162; CHECK: } 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) 169; CHECK: ] 170; CHECK: FieldList: <field list> (0x100A) 171; CHECK: SizeOf: 4 172; CHECK: Name: Union 173; CHECK: LinkageName: .?ATUnion@@ 174; CHECK: } 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 180; CHECK: } 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) 187; CHECK: ] 188; CHECK: FieldList: 0x0 189; CHECK: DerivedFrom: 0x0 190; CHECK: VShape: 0x0 191; CHECK: SizeOf: 0 192; CHECK: Name: Class 193; CHECK: LinkageName: .?AVClass@@ 194; CHECK: } 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 201; CHECK: Name: pub 202; CHECK: } 203; CHECK: DataMember { 204; CHECK: AccessSpecifier: Private (0x1) 205; CHECK: Type: int (0x74) 206; CHECK: FieldOffset: 0x4 207; CHECK: Name: priv 208; CHECK: } 209; CHECK: DataMember { 210; CHECK: AccessSpecifier: Protected (0x2) 211; CHECK: Type: int (0x74) 212; CHECK: FieldOffset: 0x8 213; CHECK: Name: prot 214; CHECK: } 215; CHECK: } 216; CHECK: Class (0x100F) { 217; CHECK: TypeLeafKind: LF_CLASS (0x1504) 218; CHECK: MemberCount: 3 219; CHECK: Properties [ (0x200) 220; CHECK: HasUniqueName (0x200) 221; CHECK: ] 222; CHECK: FieldList: <field list> (0x100E) 223; CHECK: DerivedFrom: 0x0 224; CHECK: VShape: 0x0 225; CHECK: SizeOf: 12 226; CHECK: Name: Class 227; CHECK: LinkageName: .?AVClass@@ 228; CHECK: } 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 234; CHECK: } 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) 241; CHECK: ] 242; CHECK: FieldList: 0x0 243; CHECK: DerivedFrom: 0x0 244; CHECK: VShape: 0x0 245; CHECK: SizeOf: 0 246; CHECK: Name: DerivedClass 247; CHECK: LinkageName: .?AUDerivedClass@@ 248; CHECK: } 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) 254; CHECK: IsFlat: 0 255; CHECK: IsConst: 0 256; CHECK: IsVolatile: 0 257; CHECK: IsUnaligned: 0 258; CHECK: SizeOf: 8 259; CHECK: } 260; CHECK: VFTableShape (0x1013) { 261; CHECK: TypeLeafKind: LF_VTSHAPE (0xA) 262; CHECK: VFEntryCount: 1 263; CHECK: } 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) 269; CHECK: IsFlat: 0 270; CHECK: IsConst: 0 271; CHECK: IsVolatile: 0 272; CHECK: IsUnaligned: 0 273; CHECK: SizeOf: 8 274; CHECK: } 275; CHECK: FieldList (0x1015) { 276; CHECK: TypeLeafKind: LF_FIELDLIST (0x1203) 277; CHECK: BaseClass { 278; CHECK: AccessSpecifier: Public (0x3) 279; CHECK: BaseType: Struct (0x1003) 280; CHECK: BaseOffset: 0x0 281; CHECK: } 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 288; CHECK: } 289; CHECK: VFPtr { 290; CHECK: Type: <vftable 1 methods>* (0x1014) 291; CHECK: } 292; CHECK: DataMember { 293; CHECK: AccessSpecifier: Public (0x3) 294; CHECK: Type: int (0x74) 295; CHECK: FieldOffset: 0x18 296; CHECK: Name: d 297; CHECK: } 298; CHECK: } 299; CHECK: Struct (0x1016) { 300; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505) 301; CHECK: MemberCount: 4 302; CHECK: Properties [ (0x200) 303; CHECK: HasUniqueName (0x200) 304; CHECK: ] 305; CHECK: FieldList: <field list> (0x1015) 306; CHECK: DerivedFrom: 0x0 307; CHECK: VShape: 0x0 308; CHECK: SizeOf: 48 309; CHECK: Name: DerivedClass 310; CHECK: LinkageName: .?AUDerivedClass@@ 311; CHECK: } 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 317; CHECK: } 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) 325; CHECK: ] 326; CHECK: FieldList: 0x0 327; CHECK: DerivedFrom: 0x0 328; CHECK: VShape: 0x0 329; CHECK: SizeOf: 0 330; CHECK: Name: Class::Nested 331; CHECK: LinkageName: .?AUNested@Class@@ 332; CHECK: } 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 339; CHECK: Name: n 340; CHECK: } 341; CHECK: } 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) 348; CHECK: ] 349; CHECK: FieldList: <field list> (0x1019) 350; CHECK: DerivedFrom: 0x0 351; CHECK: VShape: 0x0 352; CHECK: SizeOf: 4 353; CHECK: Name: Class::Nested 354; CHECK: LinkageName: .?AUNested@Class@@ 355; CHECK: } 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 361; CHECK: } 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) 367; CHECK: IsFlat: 0 368; CHECK: IsConst: 1 369; CHECK: IsVolatile: 0 370; CHECK: IsUnaligned: 0 371; CHECK: SizeOf: 8 372; CHECK: } 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) 380; CHECK: ] 381; CHECK: NumParameters: 0 382; CHECK: ArgListType: () (0x1000) 383; CHECK: ThisAdjustment: 0 384; CHECK: } 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 390; CHECK: } 391; CHECK: ] 392 393; ASM: .section .debug$T,"dr" 394; ASM: .p2align 2 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 414; ASM: .byte 243 415; ASM: .byte 242 416; ASM: .byte 241 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 428; ASM: .byte 242 429; ASM: .byte 241 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) ) 435; ASM: .byte 242 436; ASM: .byte 241 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 445; ASM: .byte 243 446; ASM: .byte 242 447; ASM: .byte 241 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 453; ASM: .byte 243 454; ASM: .byte 242 455; ASM: .byte 241 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 461; ASM: .byte 243 462; ASM: .byte 242 463; ASM: .byte 241 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 479; ASM: .byte 242 480; ASM: .byte 241 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 548; ASM: .byte 242 549; ASM: .byte 241 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 555; ASM: .byte 241 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 561; ASM: .byte 241 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 590; ASM: .byte 242 591; ASM: .byte 241 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 601; ASM: .byte 0x0 602; ASM: .byte 241 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 615; ASM: .byte 242 616; ASM: .byte 241 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 642; ASM: .byte 242 643; ASM: .byte 241 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 661; ASM: .byte 241 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 681; ASM: .byte 241 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 710; ASM: .byte 241 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 721; ASM: .byte 242 722; ASM: .byte 241 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 728; ASM: .byte 242 729; ASM: .byte 241 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 739; ASM: .byte 242 740; ASM: .byte 241 741 742; ModuleID = 't.cpp' 743source_filename = "t.cpp" 744target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" 745target triple = "x86_64-pc-windows-msvc19.0.23918" 746 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 } 752 753$"\01??0DerivedClass@@QEAA@XZ" = comdat any 754 755$"\01??_8DerivedClass@@7B@" = comdat any 756 757@"\01??_8DerivedClass@@7B@" = linkonce_odr unnamed_addr constant [2 x i32] [i32 -16, i32 16], comdat 758 759; Function Attrs: nounwind uwtable 760define void @"\01?UseTypes@@YAXXZ"() #0 !dbg !7 { 761entry: 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 773 ret void, !dbg !52 774} 775 776; Function Attrs: nounwind readnone 777declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 778 779; Function Attrs: inlinehint nounwind uwtable 780define linkonce_odr %struct.DerivedClass* @"\01??0DerivedClass@@QEAA@XZ"(%struct.DerivedClass* returned %this, i32 %is_most_derived) unnamed_addr #2 comdat align 2 !dbg !53 { 781entry: 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 794 795ctor.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 804 805ctor.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 809} 810 811attributes #0 = { nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "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" } 812attributes #1 = { nounwind readnone } 813attributes #2 = { inlinehint nounwind uwtable "disable-tail-calls"="false" "less-precise-fpmad"="false" "frame-pointer"="none" "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" } 814attributes #3 = { nounwind } 815 816!llvm.dbg.cu = !{!0} 817!llvm.module.flags = !{!3, !4, !5} 818!llvm.ident = !{!6} 819 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") 822!2 = !{} 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) 829!9 = !{null} 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@@") 843!23 = !{!24, !25} 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) 864!44 = !{!14} 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@@") 869!49 = !{!50} 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) 875!55 = !{null, !56} 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) 883