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 A { 8; int a; 9; void f(); 10; }; 11; void usevars(int, ...); 12; void f(float p1, double p2, long long p3) { 13; int v1 = p3; 14; int *v2 = &v1; 15; const int *v21 = &v1; 16; void *v3 = &v1; 17; int A::*v4 = &A::a; 18; void (A::*v5)() = &A::f; 19; long l1 = 0; 20; long int l2 = 0; 21; unsigned long l3 = 0; 22; unsigned long int l4 = 0; 23; const void *v6 = &v1; 24; usevars(v1, v2, v3, l1, l2, l3, l4); 25; } 26; void CharTypes() { 27; signed wchar_t w; 28; unsigned short us; 29; char c; 30; unsigned char uc; 31; signed char sc; 32; char16_t c16; 33; char32_t c32; 34; } 35; $ clang t.cpp -S -emit-llvm -g -gcodeview -o t.ll 36 37; CHECK: CodeViewTypes [ 38; CHECK: Section: .debug$T (6) 39; CHECK: Magic: 0x4 40; CHECK: ArgList (0x1000) { 41; CHECK: TypeLeafKind: LF_ARGLIST (0x1201) 42; CHECK: NumArgs: 3 43; CHECK: Arguments [ 44; CHECK: ArgType: float (0x40) 45; CHECK: ArgType: double (0x41) 46; CHECK: ArgType: __int64 (0x13) 47; CHECK: ] 48; CHECK: } 49; CHECK: Procedure (0x1001) { 50; CHECK: TypeLeafKind: LF_PROCEDURE (0x1008) 51; CHECK: ReturnType: void (0x3) 52; CHECK: CallingConvention: NearC (0x0) 53; CHECK: FunctionOptions [ (0x0) 54; CHECK: ] 55; CHECK: NumParameters: 3 56; CHECK: ArgListType: (float, double, __int64) (0x1000) 57; CHECK: } 58; CHECK: FuncId (0x1002) { 59; CHECK: TypeLeafKind: LF_FUNC_ID (0x1601) 60; CHECK: ParentScope: 0x0 61; CHECK: FunctionType: void (float, double, __int64) (0x1001) 62; CHECK: Name: f 63; CHECK: } 64; CHECK: Modifier (0x1003) { 65; CHECK: TypeLeafKind: LF_MODIFIER (0x1001) 66; CHECK: ModifiedType: int (0x74) 67; CHECK: Modifiers [ (0x1) 68; CHECK: Const (0x1) 69; CHECK: ] 70; CHECK: } 71; CHECK: Pointer (0x1004) { 72; CHECK: TypeLeafKind: LF_POINTER (0x1002) 73; CHECK: PointeeType: const int (0x1003) 74; CHECK: PtrType: Near64 (0xC) 75; CHECK: PtrMode: Pointer (0x0) 76; CHECK: IsFlat: 0 77; CHECK: IsConst: 0 78; CHECK: IsVolatile: 0 79; CHECK: IsUnaligned: 0 80; CHECK: } 81; CHECK: Struct (0x1005) { 82; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505) 83; CHECK: MemberCount: 0 84; CHECK: Properties [ (0x80) 85; CHECK: ForwardReference (0x80) 86; CHECK: ] 87; CHECK: FieldList: 0x0 88; CHECK: DerivedFrom: 0x0 89; CHECK: VShape: 0x0 90; CHECK: SizeOf: 0 91; CHECK: Name: A 92; CHECK: } 93; CHECK: Pointer (0x1006) { 94; CHECK: TypeLeafKind: LF_POINTER (0x1002) 95; CHECK: PointeeType: int (0x74) 96; CHECK: PtrType: Near64 (0xC) 97; CHECK: PtrMode: PointerToDataMember (0x2) 98; CHECK: IsFlat: 0 99; CHECK: IsConst: 0 100; CHECK: IsVolatile: 0 101; CHECK: IsUnaligned: 0 102; CHECK: ClassType: A (0x1005) 103; CHECK: Representation: GeneralData (0x4) 104; CHECK: } 105; CHECK: Pointer (0x1007) { 106; CHECK: TypeLeafKind: LF_POINTER (0x1002) 107; CHECK: PointeeType: A (0x1005) 108; CHECK: PtrType: Near64 (0xC) 109; CHECK: PtrMode: Pointer (0x0) 110; CHECK: IsFlat: 0 111; CHECK: IsConst: 1 112; CHECK: IsVolatile: 0 113; CHECK: IsUnaligned: 0 114; CHECK: } 115; CHECK: ArgList (0x1008) { 116; CHECK: TypeLeafKind: LF_ARGLIST (0x1201) 117; CHECK: NumArgs: 0 118; CHECK: Arguments [ 119; CHECK: ] 120; CHECK: } 121; CHECK: MemberFunction (0x1009) { 122; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009) 123; CHECK: ReturnType: void (0x3) 124; CHECK: ClassType: A (0x1005) 125; CHECK: ThisType: A* const (0x1007) 126; CHECK: CallingConvention: NearC (0x0) 127; CHECK: FunctionOptions [ (0x0) 128; CHECK: ] 129; CHECK: NumParameters: 0 130; CHECK: ArgListType: () (0x1008) 131; CHECK: ThisAdjustment: 0 132; CHECK: } 133; CHECK: FieldList (0x100A) { 134; CHECK: TypeLeafKind: LF_FIELDLIST (0x1203) 135; CHECK: DataMember { 136; CHECK: AccessSpecifier: Public (0x3) 137; CHECK: Type: int (0x74) 138; CHECK: FieldOffset: 0x0 139; CHECK: Name: a 140; CHECK: } 141; CHECK: OneMethod { 142; CHECK: AccessSpecifier: Public (0x3) 143; CHECK: Type: void A::() (0x1009) 144; CHECK: Name: A::f 145; CHECK: } 146; CHECK: } 147; CHECK: Struct (0x100B) { 148; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505) 149; CHECK: MemberCount: 2 150; CHECK: Properties [ (0x0) 151; CHECK: ] 152; CHECK: FieldList: <field list> (0x100A) 153; CHECK: DerivedFrom: 0x0 154; CHECK: VShape: 0x0 155; CHECK: SizeOf: 4 156; CHECK: Name: A 157; CHECK: } 158; CHECK: StringId (0x100C) { 159; CHECK: TypeLeafKind: LF_STRING_ID (0x1605) 160; CHECK: Id: 0x0 161; CHECK: StringData: D:\src\llvm\build\t.cpp 162; CHECK: } 163; CHECK: UdtSourceLine (0x100D) { 164; CHECK: TypeLeafKind: LF_UDT_SRC_LINE (0x1606) 165; CHECK: UDT: A (0x100B) 166; CHECK: SourceFile: D:\src\llvm\build\t.cpp (0x100C) 167; CHECK: LineNumber: 1 168; CHECK: } 169; CHECK: Pointer (0x100E) { 170; CHECK: TypeLeafKind: LF_POINTER (0x1002) 171; CHECK: PointeeType: void A::() (0x1009) 172; CHECK: PtrType: Near64 (0xC) 173; CHECK: PtrMode: PointerToMemberFunction (0x3) 174; CHECK: IsFlat: 0 175; CHECK: IsConst: 0 176; CHECK: IsVolatile: 0 177; CHECK: IsUnaligned: 0 178; CHECK: ClassType: A (0x1005) 179; CHECK: Representation: GeneralFunction (0x8) 180; CHECK: } 181; CHECK: Modifier (0x100F) { 182; CHECK: TypeLeafKind: LF_MODIFIER (0x1001) 183; CHECK: ModifiedType: void (0x3) 184; CHECK: Modifiers [ (0x1) 185; CHECK: Const (0x1) 186; CHECK: ] 187; CHECK: } 188; CHECK: Pointer (0x1010) { 189; CHECK: TypeLeafKind: LF_POINTER (0x1002) 190; CHECK: PointeeType: const void (0x100F) 191; CHECK: PtrType: Near64 (0xC) 192; CHECK: PtrMode: Pointer (0x0) 193; CHECK: IsFlat: 0 194; CHECK: IsConst: 0 195; CHECK: IsVolatile: 0 196; CHECK: IsUnaligned: 0 197; CHECK: } 198; CHECK: Procedure (0x1011) { 199; CHECK: TypeLeafKind: LF_PROCEDURE (0x1008) 200; CHECK: ReturnType: void (0x3) 201; CHECK: CallingConvention: NearC (0x0) 202; CHECK: FunctionOptions [ (0x0) 203; CHECK: ] 204; CHECK: NumParameters: 0 205; CHECK: ArgListType: () (0x1008) 206; CHECK: } 207; CHECK: FuncId (0x1012) { 208; CHECK: TypeLeafKind: LF_FUNC_ID (0x1601) 209; CHECK: ParentScope: 0x0 210; CHECK: FunctionType: void () (0x1011) 211; CHECK: Name: CharTypes 212; CHECK: } 213; CHECK: ] 214 215; CHECK: CodeViewDebugInfo [ 216; CHECK: Subsection [ 217; CHECK: SubSectionType: Symbols (0xF1) 218; CHECK: {{.*}}Proc{{.*}}Sym { 219; CHECK: DbgStart: 0x0 220; CHECK: DbgEnd: 0x0 221; CHECK: FunctionType: f (0x1002) 222; CHECK: CodeOffset: ?f@@YAXMN_J@Z+0x0 223; CHECK: Segment: 0x0 224; CHECK: Flags [ (0x0) 225; CHECK: ] 226; CHECK: DisplayName: f 227; CHECK: LinkageName: ?f@@YAXMN_J@Z 228; CHECK: } 229; CHECK: LocalSym { 230; CHECK: Type: float (0x40) 231; CHECK: Flags [ (0x1) 232; CHECK: IsParameter (0x1) 233; CHECK: ] 234; CHECK: VarName: p1 235; CHECK: } 236; CHECK: LocalSym { 237; CHECK: Type: double (0x41) 238; CHECK: Flags [ (0x1) 239; CHECK: IsParameter (0x1) 240; CHECK: ] 241; CHECK: VarName: p2 242; CHECK: } 243; CHECK: LocalSym { 244; CHECK: Type: __int64 (0x13) 245; CHECK: Flags [ (0x1) 246; CHECK: IsParameter (0x1) 247; CHECK: ] 248; CHECK: VarName: p3 249; CHECK: } 250; CHECK: LocalSym { 251; CHECK: Type: int (0x74) 252; CHECK: VarName: v1 253; CHECK: } 254; CHECK: LocalSym { 255; CHECK: Type: int* (0x674) 256; CHECK: VarName: v2 257; CHECK: } 258; CHECK: LocalSym { 259; CHECK: Type: const int* (0x1004) 260; CHECK: VarName: v21 261; CHECK: } 262; CHECK: LocalSym { 263; CHECK: Type: void* (0x603) 264; CHECK: VarName: v3 265; CHECK: } 266; CHECK: LocalSym { 267; CHECK: Type: int A::* (0x1006) 268; CHECK: VarName: v4 269; CHECK: } 270; CHECK: LocalSym { 271; CHECK: Type: void A::() A::* (0x100E) 272; CHECK: VarName: v5 273; CHECK: } 274; CHECK: LocalSym { 275; CHECK: Type: long (0x12) 276; CHECK: VarName: l1 277; CHECK: } 278; CHECK: LocalSym { 279; CHECK: Type: long (0x12) 280; CHECK: VarName: l2 281; CHECK: } 282; CHECK: LocalSym { 283; CHECK: Type: unsigned long (0x22) 284; CHECK: VarName: l3 285; CHECK: } 286; CHECK: LocalSym { 287; CHECK: Type: unsigned long (0x22) 288; CHECK: VarName: l4 289; CHECK: } 290; CHECK: LocalSym { 291; CHECK: Type: const void* (0x1010) 292; CHECK: VarName: v6 293; CHECK: } 294; CHECK: ProcEnd { 295; CHECK: } 296; CHECK: ] 297; CHECK: Subsection [ 298; CHECK: {{.*}}Proc{{.*}}Sym { 299; CHECK: Type: CharTypes (0x1012) 300; CHECK: DisplayName: CharTypes 301; CHECK: LinkageName: ?CharTypes@@YAXXZ 302; CHECK: } 303; CHECK: LocalSym { 304; CHECK: Type: wchar_t (0x71) 305; CHECK: Flags [ (0x0) 306; CHECK: ] 307; CHECK: VarName: w 308; CHECK: } 309; CHECK: LocalSym { 310; CHECK: Type: unsigned short (0x21) 311; CHECK: Flags [ (0x0) 312; CHECK: ] 313; CHECK: VarName: us 314; CHECK: } 315; CHECK: LocalSym { 316; CHECK: Type: char (0x70) 317; CHECK: Flags [ (0x0) 318; CHECK: ] 319; CHECK: VarName: c 320; CHECK: } 321; CHECK: LocalSym { 322; CHECK: Type: unsigned char (0x20) 323; CHECK: Flags [ (0x0) 324; CHECK: ] 325; CHECK: VarName: uc 326; CHECK: } 327; CHECK: LocalSym { 328; CHECK: Type: signed char (0x10) 329; CHECK: Flags [ (0x0) 330; CHECK: ] 331; CHECK: VarName: sc 332; CHECK: } 333; CHECK: LocalSym { 334; CHECK: Type: char16_t (0x7A) 335; CHECK: Flags [ (0x0) 336; CHECK: ] 337; CHECK: VarName: c16 338; CHECK: } 339; CHECK: LocalSym { 340; CHECK: Type: char32_t (0x7B) 341; CHECK: Flags [ (0x0) 342; CHECK: ] 343; CHECK: VarName: c32 344; CHECK: } 345; CHECK: ProcEnd { 346; CHECK: } 347; CHECK: ] 348; CHECK: ] 349 350; ASM: .section .debug$T,"dr" 351; ASM: .p2align 2 352; ASM: .long 4 # Debug section magic 353; ASM: .short 0x12 # Record length 354; ASM: .short 0x1201 # Record kind: LF_ARGLIST 355; ASM: .long 0x3 # NumArgs 356; ASM: .long 0x40 # Argument 357; ASM: .long 0x41 # Argument 358; ASM: .long 0x13 # Argument 359; ASM: # ArgList (0x1000) { 360; ASM: # TypeLeafKind: LF_ARGLIST (0x1201) 361; ASM: # NumArgs: 3 362; ASM: # Arguments [ 363; ASM: # ArgType: float (0x40) 364; ASM: # ArgType: double (0x41) 365; ASM: # ArgType: __int64 (0x13) 366; ASM: # ] 367; ASM: # } 368; ASM: .short 0xe # Record length 369; ASM: .short 0x1008 # Record kind: LF_PROCEDURE 370; ASM: .long 0x3 # ReturnType 371; ASM: .byte 0x0 # CallingConvention 372; ASM: .byte 0x0 # FunctionOptions 373; ASM: .short 0x3 # NumParameters 374; ASM: .long 0x1000 # ArgListType 375; ASM: # Procedure (0x1001) { 376; ASM: # TypeLeafKind: LF_PROCEDURE (0x1008) 377; ASM: # ReturnType: void (0x3) 378; ASM: # CallingConvention: NearC (0x0) 379; ASM: # FunctionOptions [ (0x0) 380; ASM: # ] 381; ASM: # NumParameters: 3 382; ASM: # ArgListType: (float, double, __int64) (0x1000) 383; ASM: # } 384; ASM: .short 0xe # Record length 385; ASM: .short 0x1601 # Record kind: LF_FUNC_ID 386; ASM: .long 0x0 # ParentScope 387; ASM: .long 0x1001 # FunctionType 388; ASM: .asciz "f" # Name 389; ASM: .byte 242 390; ASM: .byte 241 391; ASM: # FuncId (0x1002) { 392; ASM: # TypeLeafKind: LF_FUNC_ID (0x1601) 393; ASM: # ParentScope: 0x0 394; ASM: # FunctionType: void (float, double, __int64) (0x1001) 395; ASM: # Name: f 396; ASM: # } 397; ASM: .short 0xa # Record length 398; ASM: .short 0x1001 # Record kind: LF_MODIFIER 399; ASM: .long 0x74 # ModifiedType 400; ASM: .short 0x1 # Modifiers 401; ASM: .byte 242 402; ASM: .byte 241 403; ASM: # Modifier (0x1003) { 404; ASM: # TypeLeafKind: LF_MODIFIER (0x1001) 405; ASM: # ModifiedType: int (0x74) 406; ASM: # Modifiers [ (0x1) 407; ASM: # Const (0x1) 408; ASM: # ] 409; ASM: # } 410; ASM: .short 0xa # Record length 411; ASM: .short 0x1002 # Record kind: LF_POINTER 412; ASM: .long 0x1003 # PointeeType 413; ASM: .long 0x1000c # Attributes 414; ASM: # Pointer (0x1004) { 415; ASM: # TypeLeafKind: LF_POINTER (0x1002) 416; ASM: # PointeeType: const int (0x1003) 417; ASM: # PtrType: Near64 (0xC) 418; ASM: # PtrMode: Pointer (0x0) 419; ASM: # IsFlat: 0 420; ASM: # IsConst: 0 421; ASM: # IsVolatile: 0 422; ASM: # IsUnaligned: 0 423; ASM: # IsRestrict: 0 424; ASM: # IsThisPtr&: 0 425; ASM: # IsThisPtr&&: 0 426; ASM: # SizeOf: 8 427; ASM: # } 428; ASM: .short 0x16 # Record length 429; ASM: .short 0x1505 # Record kind: LF_STRUCTURE 430; ASM: .short 0x0 # MemberCount 431; ASM: .short 0x80 # Properties 432; ASM: .long 0x0 # FieldList 433; ASM: .long 0x0 # DerivedFrom 434; ASM: .long 0x0 # VShape 435; ASM: .short 0x0 # SizeOf 436; ASM: .asciz "A" # Name 437; ASM: # Struct (0x1005) { 438; ASM: # TypeLeafKind: LF_STRUCTURE (0x1505) 439; ASM: # MemberCount: 0 440; ASM: # Properties [ (0x80) 441; ASM: # ForwardReference (0x80) 442; ASM: # ] 443; ASM: # FieldList: 0x0 444; ASM: # DerivedFrom: 0x0 445; ASM: # VShape: 0x0 446; ASM: # SizeOf: 0 447; ASM: # Name: A 448; ASM: # } 449; ASM: .short 0x12 # Record length 450; ASM: .short 0x1002 # Record kind: LF_POINTER 451; ASM: .long 0x74 # PointeeType 452; ASM: .long 0x804c # Attributes 453; ASM: .long 0x1005 # ClassType 454; ASM: .short 0x4 # Representation 455; ASM: .byte 242 456; ASM: .byte 241 457; ASM: # Pointer (0x1006) { 458; ASM: # TypeLeafKind: LF_POINTER (0x1002) 459; ASM: # PointeeType: int (0x74) 460; ASM: # PtrType: Near64 (0xC) 461; ASM: # PtrMode: PointerToDataMember (0x2) 462; ASM: # IsFlat: 0 463; ASM: # IsConst: 0 464; ASM: # IsVolatile: 0 465; ASM: # IsUnaligned: 0 466; ASM: # IsRestrict: 0 467; ASM: # IsThisPtr&: 0 468; ASM: # IsThisPtr&&: 0 469; ASM: # SizeOf: 4 470; ASM: # ClassType: A (0x1005) 471; ASM: # Representation: GeneralData (0x4) 472; ASM: # } 473; ASM: .short 0xa # Record length 474; ASM: .short 0x1002 # Record kind: LF_POINTER 475; ASM: .long 0x1005 # PointeeType 476; ASM: .long 0x1040c # Attributes 477; ASM: # Pointer (0x1007) { 478; ASM: # TypeLeafKind: LF_POINTER (0x1002) 479; ASM: # PointeeType: A (0x1005) 480; ASM: # PtrType: Near64 (0xC) 481; ASM: # PtrMode: Pointer (0x0) 482; ASM: # IsFlat: 0 483; ASM: # IsConst: 1 484; ASM: # IsVolatile: 0 485; ASM: # IsUnaligned: 0 486; ASM: # IsRestrict: 0 487; ASM: # IsThisPtr&: 0 488; ASM: # IsThisPtr&&: 0 489; ASM: # SizeOf: 8 490; ASM: # } 491; ASM: .short 0x6 # Record length 492; ASM: .short 0x1201 # Record kind: LF_ARGLIST 493; ASM: .long 0x0 # NumArgs 494; ASM: # ArgList (0x1008) { 495; ASM: # TypeLeafKind: LF_ARGLIST (0x1201) 496; ASM: # NumArgs: 0 497; ASM: # Arguments [ 498; ASM: # ] 499; ASM: # } 500; ASM: .short 0x1a # Record length 501; ASM: .short 0x1009 # Record kind: LF_MFUNCTION 502; ASM: .long 0x3 # ReturnType 503; ASM: .long 0x1005 # ClassType 504; ASM: .long 0x1007 # ThisType 505; ASM: .byte 0x0 # CallingConvention 506; ASM: .byte 0x0 # FunctionOptions 507; ASM: .short 0x0 # NumParameters 508; ASM: .long 0x1008 # ArgListType 509; ASM: .long 0x0 # ThisAdjustment 510; ASM: # MemberFunction (0x1009) { 511; ASM: # TypeLeafKind: LF_MFUNCTION (0x1009) 512; ASM: # ReturnType: void (0x3) 513; ASM: # ClassType: A (0x1005) 514; ASM: # ThisType: A* const (0x1007) 515; ASM: # CallingConvention: NearC (0x0) 516; ASM: # FunctionOptions [ (0x0) 517; ASM: # ] 518; ASM: # NumParameters: 0 519; ASM: # ArgListType: () (0x1008) 520; ASM: # ThisAdjustment: 0 521; ASM: # } 522; ASM: .short 0x1e # Record length 523; ASM: .short 0x1203 # Record kind: LF_FIELDLIST 524; ASM: .byte 0x0d, 0x15, 0x03, 0x00 525; ASM: .byte 0x74, 0x00, 0x00, 0x00 526; ASM: .byte 0x00, 0x00, 0x61, 0x00 527; ASM: .byte 0x11, 0x15, 0x03, 0x00 528; ASM: .byte 0x09, 0x10, 0x00, 0x00 529; ASM: .byte 0x41, 0x3a, 0x3a, 0x66 530; ASM: .byte 0x00, 0xf3, 0xf2, 0xf1 531; ASM: # FieldList (0x100A) { 532; ASM: # TypeLeafKind: LF_FIELDLIST (0x1203) 533; ASM: # DataMember { 534; ASM: # TypeLeafKind: LF_MEMBER (0x150D) 535; ASM: # AccessSpecifier: Public (0x3) 536; ASM: # Type: int (0x74) 537; ASM: # FieldOffset: 0x0 538; ASM: # Name: a 539; ASM: # } 540; ASM: # OneMethod { 541; ASM: # TypeLeafKind: LF_ONEMETHOD (0x1511) 542; ASM: # AccessSpecifier: Public (0x3) 543; ASM: # Type: void A::() (0x1009) 544; ASM: # Name: A::f 545; ASM: # } 546; ASM: # } 547; ASM: .short 0x16 # Record length 548; ASM: .short 0x1505 # Record kind: LF_STRUCTURE 549; ASM: .short 0x2 # MemberCount 550; ASM: .short 0x0 # Properties 551; ASM: .long 0x100a # FieldList 552; ASM: .long 0x0 # DerivedFrom 553; ASM: .long 0x0 # VShape 554; ASM: .short 0x4 # SizeOf 555; ASM: .asciz "A" # Name 556; ASM: # Struct (0x100B) { 557; ASM: # TypeLeafKind: LF_STRUCTURE (0x1505) 558; ASM: # MemberCount: 2 559; ASM: # Properties [ (0x0) 560; ASM: # ] 561; ASM: # FieldList: <field list> (0x100A) 562; ASM: # DerivedFrom: 0x0 563; ASM: # VShape: 0x0 564; ASM: # SizeOf: 4 565; ASM: # Name: A 566; ASM: # } 567; ASM: .short 0x1e # Record length 568; ASM: .short 0x1605 # Record kind: LF_STRING_ID 569; ASM: .long 0x0 # Id 570; ASM: .asciz "D:\\src\\llvm\\build\\t.cpp" # StringData 571; ASM: # StringId (0x100C) { 572; ASM: # TypeLeafKind: LF_STRING_ID (0x1605) 573; ASM: # Id: 0x0 574; ASM: # StringData: D:\src\llvm\build\t.cpp 575; ASM: # } 576; ASM: .short 0xe # Record length 577; ASM: .short 0x1606 # Record kind: LF_UDT_SRC_LINE 578; ASM: .long 0x100b # UDT 579; ASM: .long 0x100c # SourceFile 580; ASM: .long 0x1 # LineNumber 581; ASM: # UdtSourceLine (0x100D) { 582; ASM: # TypeLeafKind: LF_UDT_SRC_LINE (0x1606) 583; ASM: # UDT: A (0x100B) 584; ASM: # SourceFile: D:\src\llvm\build\t.cpp (0x100C) 585; ASM: # LineNumber: 1 586; ASM: # } 587; ASM: .short 0x12 # Record length 588; ASM: .short 0x1002 # Record kind: LF_POINTER 589; ASM: .long 0x1009 # PointeeType 590; ASM: .long 0x1006c # Attributes 591; ASM: .long 0x1005 # ClassType 592; ASM: .short 0x8 # Representation 593; ASM: .byte 242 594; ASM: .byte 241 595; ASM: # Pointer (0x100E) { 596; ASM: # TypeLeafKind: LF_POINTER (0x1002) 597; ASM: # PointeeType: void A::() (0x1009) 598; ASM: # PtrType: Near64 (0xC) 599; ASM: # PtrMode: PointerToMemberFunction (0x3) 600; ASM: # IsFlat: 0 601; ASM: # IsConst: 0 602; ASM: # IsVolatile: 0 603; ASM: # IsUnaligned: 0 604; ASM: # IsRestrict: 0 605; ASM: # IsThisPtr&: 0 606; ASM: # IsThisPtr&&: 0 607; ASM: # SizeOf: 8 608; ASM: # ClassType: A (0x1005) 609; ASM: # Representation: GeneralFunction (0x8) 610; ASM: # } 611; ASM: .short 0xa # Record length 612; ASM: .short 0x1001 # Record kind: LF_MODIFIER 613; ASM: .long 0x3 # ModifiedType 614; ASM: .short 0x1 # Modifiers 615; ASM: .byte 242 616; ASM: .byte 241 617; ASM: # Modifier (0x100F) { 618; ASM: # TypeLeafKind: LF_MODIFIER (0x1001) 619; ASM: # ModifiedType: void (0x3) 620; ASM: # Modifiers [ (0x1) 621; ASM: # Const (0x1) 622; ASM: # ] 623; ASM: # } 624; ASM: .short 0xa # Record length 625; ASM: .short 0x1002 # Record kind: LF_POINTER 626; ASM: .long 0x100f # PointeeType 627; ASM: .long 0x1000c # Attributes 628; ASM: # Pointer (0x1010) { 629; ASM: # TypeLeafKind: LF_POINTER (0x1002) 630; ASM: # PointeeType: const void (0x100F) 631; ASM: # PtrType: Near64 (0xC) 632; ASM: # PtrMode: Pointer (0x0) 633; ASM: # IsFlat: 0 634; ASM: # IsConst: 0 635; ASM: # IsVolatile: 0 636; ASM: # IsUnaligned: 0 637; ASM: # IsRestrict: 0 638; ASM: # IsThisPtr&: 0 639; ASM: # IsThisPtr&&: 0 640; ASM: # SizeOf: 8 641; ASM: # } 642; ASM: .short 0xe # Record length 643; ASM: .short 0x1008 # Record kind: LF_PROCEDURE 644; ASM: .long 0x3 # ReturnType 645; ASM: .byte 0x0 # CallingConvention 646; ASM: .byte 0x0 # FunctionOptions 647; ASM: .short 0x0 # NumParameters 648; ASM: .long 0x1008 # ArgListType 649; ASM: # Procedure (0x1011) { 650; ASM: # TypeLeafKind: LF_PROCEDURE (0x1008) 651; ASM: # ReturnType: void (0x3) 652; ASM: # CallingConvention: NearC (0x0) 653; ASM: # FunctionOptions [ (0x0) 654; ASM: # ] 655; ASM: # NumParameters: 0 656; ASM: # ArgListType: () (0x1008) 657; ASM: # } 658; ASM: .short 0x16 # Record length 659; ASM: .short 0x1601 # Record kind: LF_FUNC_ID 660; ASM: .long 0x0 # ParentScope 661; ASM: .long 0x1011 # FunctionType 662; ASM: .asciz "CharTypes" # Name 663; ASM: .byte 242 664; ASM: .byte 241 665; ASM: # FuncId (0x1012) { 666; ASM: # TypeLeafKind: LF_FUNC_ID (0x1601) 667; ASM: # ParentScope: 0x0 668; ASM: # FunctionType: void () (0x1011) 669; ASM: # Name: CharTypes 670; ASM: # } 671; ASM: .short 0x1a # Record length 672; ASM: .short 0x1605 # Record kind: LF_STRING_ID 673; ASM: .long 0x0 # Id 674; ASM: .asciz "D:\\src\\llvm\\build" # StringData 675; ASM: .byte 242 676; ASM: .byte 241 677; ASM: # StringId (0x1013) { 678; ASM: # TypeLeafKind: LF_STRING_ID (0x1605) 679; ASM: # Id: 0x0 680; ASM: # StringData: D:\src\llvm\build 681; ASM: # } 682; ASM: .short 0xe # Record length 683; ASM: .short 0x1605 # Record kind: LF_STRING_ID 684; ASM: .long 0x0 # Id 685; ASM: .asciz "t.cpp" # StringData 686; ASM: .byte 242 687; ASM: .byte 241 688; ASM: # StringId (0x1014) { 689; ASM: # TypeLeafKind: LF_STRING_ID (0x1605) 690; ASM: # Id: 0x0 691; ASM: # StringData: t.cpp 692; ASM: # } 693; ASM: .short 0x1a # Record length 694; ASM: .short 0x1603 # Record kind: LF_BUILDINFO 695; ASM: .short 0x5 # NumArgs 696; ASM: .long 0x1013 # Argument 697; ASM: .long 0x0 # Argument 698; ASM: .long 0x1014 # Argument 699; ASM: .long 0x0 # Argument 700; ASM: .long 0x0 # Argument 701; ASM: .byte 242 702; ASM: .byte 241 703; ASM: # BuildInfo (0x1015) { 704; ASM: # TypeLeafKind: LF_BUILDINFO (0x1603) 705; ASM: # NumArgs: 5 706; ASM: # Arguments [ 707; ASM: # ArgType: D:\src\llvm\build (0x1013) 708; ASM: # ArgType: 0x0 709; ASM: # ArgType: t.cpp (0x1014) 710; ASM: # ArgType: 0x0 711; ASM: # ArgType: 0x0 712; ASM: # ] 713; ASM: # } 714 715; ModuleID = 't.cpp' 716source_filename = "t.cpp" 717target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" 718target triple = "x86_64-pc-windows-msvc19.0.23918" 719 720%struct.A = type { i32 } 721 722; Function Attrs: uwtable 723define void @"\01?f@@YAXMN_J@Z"(float %p1, double %p2, i64 %p3) #0 !dbg !7 { 724entry: 725 %p3.addr = alloca i64, align 8 726 %p2.addr = alloca double, align 8 727 %p1.addr = alloca float, align 4 728 %v1 = alloca i32, align 4 729 %v2 = alloca i32*, align 8 730 %v21 = alloca i32*, align 8 731 %v3 = alloca i8*, align 8 732 %v4 = alloca i32, align 8 733 %v5 = alloca i8*, align 8 734 %l1 = alloca i32, align 4 735 %l2 = alloca i32, align 4 736 %l3 = alloca i32, align 4 737 %l4 = alloca i32, align 4 738 %v6 = alloca i8*, align 8 739 store i64 %p3, i64* %p3.addr, align 8 740 call void @llvm.dbg.declare(metadata i64* %p3.addr, metadata !13, metadata !14), !dbg !15 741 store double %p2, double* %p2.addr, align 8 742 call void @llvm.dbg.declare(metadata double* %p2.addr, metadata !16, metadata !14), !dbg !17 743 store float %p1, float* %p1.addr, align 4 744 call void @llvm.dbg.declare(metadata float* %p1.addr, metadata !18, metadata !14), !dbg !19 745 call void @llvm.dbg.declare(metadata i32* %v1, metadata !20, metadata !14), !dbg !22 746 %0 = load i64, i64* %p3.addr, align 8, !dbg !23 747 %conv = trunc i64 %0 to i32, !dbg !23 748 store i32 %conv, i32* %v1, align 4, !dbg !22 749 call void @llvm.dbg.declare(metadata i32** %v2, metadata !24, metadata !14), !dbg !26 750 store i32* %v1, i32** %v2, align 8, !dbg !26 751 call void @llvm.dbg.declare(metadata i32** %v21, metadata !27, metadata !14), !dbg !30 752 store i32* %v1, i32** %v21, align 8, !dbg !30 753 call void @llvm.dbg.declare(metadata i8** %v3, metadata !31, metadata !14), !dbg !33 754 %1 = bitcast i32* %v1 to i8*, !dbg !34 755 store i8* %1, i8** %v3, align 8, !dbg !33 756 call void @llvm.dbg.declare(metadata i32* %v4, metadata !35, metadata !14), !dbg !44 757 store i32 0, i32* %v4, align 8, !dbg !44 758 call void @llvm.dbg.declare(metadata i8** %v5, metadata !45, metadata !14), !dbg !47 759 store i8* bitcast (void (%struct.A*)* @"\01?f@A@@QEAAXXZ" to i8*), i8** %v5, align 8, !dbg !47 760 call void @llvm.dbg.declare(metadata i32* %l1, metadata !48, metadata !14), !dbg !50 761 store i32 0, i32* %l1, align 4, !dbg !50 762 call void @llvm.dbg.declare(metadata i32* %l2, metadata !51, metadata !14), !dbg !52 763 store i32 0, i32* %l2, align 4, !dbg !52 764 call void @llvm.dbg.declare(metadata i32* %l3, metadata !53, metadata !14), !dbg !55 765 store i32 0, i32* %l3, align 4, !dbg !55 766 call void @llvm.dbg.declare(metadata i32* %l4, metadata !56, metadata !14), !dbg !57 767 store i32 0, i32* %l4, align 4, !dbg !57 768 call void @llvm.dbg.declare(metadata i8** %v6, metadata !58, metadata !14), !dbg !61 769 %2 = bitcast i32* %v1 to i8*, !dbg !62 770 store i8* %2, i8** %v6, align 8, !dbg !61 771 %3 = load i32, i32* %l4, align 4, !dbg !63 772 %4 = load i32, i32* %l3, align 4, !dbg !64 773 %5 = load i32, i32* %l2, align 4, !dbg !65 774 %6 = load i32, i32* %l1, align 4, !dbg !66 775 %7 = load i8*, i8** %v3, align 8, !dbg !67 776 %8 = load i32*, i32** %v2, align 8, !dbg !68 777 %9 = load i32, i32* %v1, align 4, !dbg !69 778 call void (i32, ...) @"\01?usevars@@YAXHZZ"(i32 %9, i32* %8, i8* %7, i32 %6, i32 %5, i32 %4, i32 %3), !dbg !70 779 ret void, !dbg !71 780} 781 782; Function Attrs: nounwind readnone 783declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 784 785declare void @"\01?f@A@@QEAAXXZ"(%struct.A*) #2 786 787declare void @"\01?usevars@@YAXHZZ"(i32, ...) #2 788 789; Function Attrs: nounwind uwtable 790define void @"\01?CharTypes@@YAXXZ"() #3 !dbg !72 { 791entry: 792 %w = alloca i16, align 2 793 %us = alloca i16, align 2 794 %c = alloca i8, align 1 795 %uc = alloca i8, align 1 796 %sc = alloca i8, align 1 797 %c16 = alloca i16, align 2 798 %c32 = alloca i32, align 4 799 call void @llvm.dbg.declare(metadata i16* %w, metadata !75, metadata !14), !dbg !77 800 call void @llvm.dbg.declare(metadata i16* %us, metadata !78, metadata !14), !dbg !80 801 call void @llvm.dbg.declare(metadata i8* %c, metadata !81, metadata !14), !dbg !83 802 call void @llvm.dbg.declare(metadata i8* %uc, metadata !84, metadata !14), !dbg !86 803 call void @llvm.dbg.declare(metadata i8* %sc, metadata !87, metadata !14), !dbg !89 804 call void @llvm.dbg.declare(metadata i16* %c16, metadata !90, metadata !14), !dbg !92 805 call void @llvm.dbg.declare(metadata i32* %c32, metadata !93, metadata !14), !dbg !95 806 ret void, !dbg !96 807} 808 809attributes #0 = { 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" } 810attributes #1 = { nounwind readnone } 811attributes #2 = { "disable-tail-calls"="false" "less-precise-fpmad"="false" "no-frame-pointer-elim"="false" "no-infs-fp-math"="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 #3 = { 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" } 813 814!llvm.dbg.cu = !{!0} 815!llvm.module.flags = !{!3, !4, !5} 816!llvm.ident = !{!6} 817 818!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) 819!1 = !DIFile(filename: "t.cpp", directory: "D:\5Csrc\5Cllvm\5Cbuild") 820!2 = !{} 821!3 = !{i32 2, !"CodeView", i32 1} 822!4 = !{i32 2, !"Debug Info Version", i32 3} 823!5 = !{i32 1, !"PIC Level", i32 2} 824!6 = !{!"clang version 3.9.0 "} 825!7 = distinct !DISubprogram(name: "f", linkageName: "\01?f@@YAXMN_J@Z", scope: !1, file: !1, line: 6, type: !8, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2) 826!8 = !DISubroutineType(types: !9) 827!9 = !{null, !10, !11, !12} 828!10 = !DIBasicType(name: "float", size: 32, align: 32, encoding: DW_ATE_float) 829!11 = !DIBasicType(name: "double", size: 64, align: 64, encoding: DW_ATE_float) 830!12 = !DIBasicType(name: "long long int", size: 64, align: 64, encoding: DW_ATE_signed) 831!13 = !DILocalVariable(name: "p3", arg: 3, scope: !7, file: !1, line: 6, type: !12) 832!14 = !DIExpression() 833!15 = !DILocation(line: 6, column: 39, scope: !7) 834!16 = !DILocalVariable(name: "p2", arg: 2, scope: !7, file: !1, line: 6, type: !11) 835!17 = !DILocation(line: 6, column: 25, scope: !7) 836!18 = !DILocalVariable(name: "p1", arg: 1, scope: !7, file: !1, line: 6, type: !10) 837!19 = !DILocation(line: 6, column: 14, scope: !7) 838!20 = !DILocalVariable(name: "v1", scope: !7, file: !1, line: 7, type: !21) 839!21 = !DIBasicType(name: "int", size: 32, align: 32, encoding: DW_ATE_signed) 840!22 = !DILocation(line: 7, column: 7, scope: !7) 841!23 = !DILocation(line: 7, column: 12, scope: !7) 842!24 = !DILocalVariable(name: "v2", scope: !7, file: !1, line: 8, type: !25) 843!25 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !21, size: 64, align: 64) 844!26 = !DILocation(line: 8, column: 8, scope: !7) 845!27 = !DILocalVariable(name: "v21", scope: !7, file: !1, line: 9, type: !28) 846!28 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !29, size: 64, align: 64) 847!29 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !21) 848!30 = !DILocation(line: 9, column: 14, scope: !7) 849!31 = !DILocalVariable(name: "v3", scope: !7, file: !1, line: 10, type: !32) 850!32 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: null, size: 64, align: 64) 851!33 = !DILocation(line: 10, column: 9, scope: !7) 852!34 = !DILocation(line: 10, column: 14, scope: !7) 853!35 = !DILocalVariable(name: "v4", scope: !7, file: !1, line: 11, type: !36) 854!36 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !21, size: 32, extraData: !37) 855!37 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "A", file: !1, line: 1, size: 32, align: 32, elements: !38) 856!38 = !{!39, !40} 857!39 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !37, file: !1, line: 2, baseType: !21, size: 32, align: 32) 858!40 = !DISubprogram(name: "A::f", linkageName: "\01?f@A@@QEAAXXZ", scope: !37, file: !1, line: 3, type: !41, isLocal: false, isDefinition: false, scopeLine: 3, flags: DIFlagPrototyped, isOptimized: false) 859!41 = !DISubroutineType(types: !42) 860!42 = !{null, !43} 861!43 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !37, size: 64, align: 64, flags: DIFlagArtificial | DIFlagObjectPointer) 862!44 = !DILocation(line: 11, column: 11, scope: !7) 863!45 = !DILocalVariable(name: "v5", scope: !7, file: !1, line: 12, type: !46) 864!46 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !41, size: 64, extraData: !37) 865!47 = !DILocation(line: 12, column: 13, scope: !7) 866!48 = !DILocalVariable(name: "l1", scope: !7, file: !1, line: 13, type: !49) 867!49 = !DIBasicType(name: "long int", size: 32, align: 32, encoding: DW_ATE_signed) 868!50 = !DILocation(line: 13, column: 8, scope: !7) 869!51 = !DILocalVariable(name: "l2", scope: !7, file: !1, line: 14, type: !49) 870!52 = !DILocation(line: 14, column: 12, scope: !7) 871!53 = !DILocalVariable(name: "l3", scope: !7, file: !1, line: 15, type: !54) 872!54 = !DIBasicType(name: "long unsigned int", size: 32, align: 32, encoding: DW_ATE_unsigned) 873!55 = !DILocation(line: 15, column: 17, scope: !7) 874!56 = !DILocalVariable(name: "l4", scope: !7, file: !1, line: 16, type: !54) 875!57 = !DILocation(line: 16, column: 21, scope: !7) 876!58 = !DILocalVariable(name: "v6", scope: !7, file: !1, line: 17, type: !59) 877!59 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !60, size: 64, align: 64) 878!60 = !DIDerivedType(tag: DW_TAG_const_type, baseType: null) 879!61 = !DILocation(line: 17, column: 15, scope: !7) 880!62 = !DILocation(line: 17, column: 20, scope: !7) 881!63 = !DILocation(line: 18, column: 35, scope: !7) 882!64 = !DILocation(line: 18, column: 31, scope: !7) 883!65 = !DILocation(line: 18, column: 27, scope: !7) 884!66 = !DILocation(line: 18, column: 23, scope: !7) 885!67 = !DILocation(line: 18, column: 19, scope: !7) 886!68 = !DILocation(line: 18, column: 15, scope: !7) 887!69 = !DILocation(line: 18, column: 11, scope: !7) 888!70 = !DILocation(line: 18, column: 3, scope: !7) 889!71 = !DILocation(line: 19, column: 1, scope: !7) 890!72 = distinct !DISubprogram(name: "CharTypes", linkageName: "\01?CharTypes@@YAXXZ", scope: !1, file: !1, line: 20, type: !73, isLocal: false, isDefinition: true, scopeLine: 20, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2) 891!73 = !DISubroutineType(types: !74) 892!74 = !{null} 893!75 = !DILocalVariable(name: "w", scope: !72, file: !1, line: 21, type: !76) 894!76 = !DIBasicType(name: "wchar_t", size: 16, align: 16, encoding: DW_ATE_unsigned) 895!77 = !DILocation(line: 21, column: 18, scope: !72) 896!78 = !DILocalVariable(name: "us", scope: !72, file: !1, line: 22, type: !79) 897!79 = !DIBasicType(name: "unsigned short", size: 16, align: 16, encoding: DW_ATE_unsigned) 898!80 = !DILocation(line: 22, column: 18, scope: !72) 899!81 = !DILocalVariable(name: "c", scope: !72, file: !1, line: 23, type: !82) 900!82 = !DIBasicType(name: "char", size: 8, align: 8, encoding: DW_ATE_signed_char) 901!83 = !DILocation(line: 23, column: 8, scope: !72) 902!84 = !DILocalVariable(name: "uc", scope: !72, file: !1, line: 24, type: !85) 903!85 = !DIBasicType(name: "unsigned char", size: 8, align: 8, encoding: DW_ATE_unsigned_char) 904!86 = !DILocation(line: 24, column: 17, scope: !72) 905!87 = !DILocalVariable(name: "sc", scope: !72, file: !1, line: 25, type: !88) 906!88 = !DIBasicType(name: "signed char", size: 8, align: 8, encoding: DW_ATE_signed_char) 907!89 = !DILocation(line: 25, column: 15, scope: !72) 908!90 = !DILocalVariable(name: "c16", scope: !72, file: !1, line: 26, type: !91) 909!91 = !DIBasicType(name: "char16_t", size: 16, align: 16, encoding: DW_ATE_UTF) 910!92 = !DILocation(line: 26, column: 12, scope: !72) 911!93 = !DILocalVariable(name: "c32", scope: !72, file: !1, line: 27, type: !94) 912!94 = !DIBasicType(name: "char32_t", size: 32, align: 32, encoding: DW_ATE_UTF) 913!95 = !DILocation(line: 27, column: 12, scope: !72) 914!96 = !DILocation(line: 28, column: 1, scope: !72) 915