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 4; C++ source to regenerate: 5; $ cat m.cpp 6; union Union { 7; int * __restrict x_member; 8; float * __restrict y_member; 9; int* volatile __restrict m_volatile; 10; }; 11; 12; int f(const volatile int* __restrict arg_crv) { 13; Union u; 14; const int *p; 15; const volatile int v = 0; 16; return 1; 17; } 18; 19; void g(int& __restrict arg_ref) { 20; const int x = 10; 21; const char str[] = "abc"; 22; } 23; 24; void h() { 25; struct Foo { 26; int a; 27; int func(int x) __restrict { return 1; } 28; }; 29; 30; Foo s = { 10 }; 31; 32; int* __restrict p_object = &s.a; 33; 34; int Foo:: * __restrict p_data_member = &Foo::a; 35; 36; int (Foo::* p_member_func)(int) __restrict = &Foo::func; 37; } 38; 39; $ clang++ m.cpp -S -emit-llvm -g -gcodeview -o m.ll 40 41 42; CHECK: CodeViewTypes [ 43; CHECK: Section: .debug$T (7) 44; CHECK: Magic: 0x4 45; CHECK: Modifier (0x1000) { 46; CHECK: TypeLeafKind: LF_MODIFIER (0x1001) 47; CHECK: ModifiedType: int (0x74) 48; CHECK: Modifiers [ (0x3) 49; CHECK: Const (0x1) 50; CHECK: Volatile (0x2) 51; CHECK: ] 52; CHECK: } 53; CHECK: Pointer (0x1001) { 54; CHECK: TypeLeafKind: LF_POINTER (0x1002) 55; CHECK: PointeeType: const volatile int (0x1000) 56; CHECK: PtrType: Near64 (0xC) 57; CHECK: PtrMode: Pointer (0x0) 58; CHECK: IsFlat: 0 59; CHECK: IsConst: 0 60; CHECK: IsVolatile: 0 61; CHECK: IsUnaligned: 0 62; CHECK: IsRestrict: 1 63; CHECK: SizeOf: 8 64; CHECK: } 65; CHECK: ArgList (0x1002) { 66; CHECK: TypeLeafKind: LF_ARGLIST (0x1201) 67; CHECK: NumArgs: 1 68; CHECK: Arguments [ 69; CHECK: ArgType: const volatile int* __restrict (0x1001) 70; CHECK: ] 71; CHECK: } 72; CHECK: Procedure (0x1003) { 73; CHECK: TypeLeafKind: LF_PROCEDURE (0x1008) 74; CHECK: ReturnType: int (0x74) 75; CHECK: CallingConvention: NearC (0x0) 76; CHECK: FunctionOptions [ (0x0) 77; CHECK: ] 78; CHECK: NumParameters: 1 79; CHECK: ArgListType: (const volatile int* __restrict) (0x1002) 80; CHECK: } 81; CHECK: FuncId (0x1004) { 82; CHECK: TypeLeafKind: LF_FUNC_ID (0x1601) 83; CHECK: ParentScope: 0x0 84; CHECK: FunctionType: int (const volatile int* __restrict) (0x1003) 85; CHECK: Name: f 86; CHECK: } 87; CHECK: Union (0x1005) { 88; CHECK: TypeLeafKind: LF_UNION (0x1506) 89; CHECK: MemberCount: 0 90; CHECK: Properties [ (0x280) 91; CHECK: ForwardReference (0x80) 92; CHECK: HasUniqueName (0x200) 93; CHECK: ] 94; CHECK: FieldList: 0x0 95; CHECK: SizeOf: 0 96; CHECK: Name: Union 97; CHECK: LinkageName: .?ATUnion@@ 98; CHECK: } 99; CHECK: Pointer (0x1006) { 100; CHECK: TypeLeafKind: LF_POINTER (0x1002) 101; CHECK: PointeeType: int (0x74) 102; CHECK: PtrType: Near64 (0xC) 103; CHECK: PtrMode: Pointer (0x0) 104; CHECK: IsFlat: 0 105; CHECK: IsConst: 0 106; CHECK: IsVolatile: 0 107; CHECK: IsUnaligned: 0 108; CHECK: IsRestrict: 1 109; CHECK: SizeOf: 8 110; CHECK: } 111; CHECK: Pointer (0x1007) { 112; CHECK: TypeLeafKind: LF_POINTER (0x1002) 113; CHECK: PointeeType: float (0x40) 114; CHECK: PtrType: Near64 (0xC) 115; CHECK: PtrMode: Pointer (0x0) 116; CHECK: IsFlat: 0 117; CHECK: IsConst: 0 118; CHECK: IsVolatile: 0 119; CHECK: IsUnaligned: 0 120; CHECK: IsRestrict: 1 121; CHECK: SizeOf: 8 122; CHECK: } 123; CHECK: Pointer (0x1008) { 124; CHECK: TypeLeafKind: LF_POINTER (0x1002) 125; CHECK: PointeeType: int (0x74) 126; CHECK: PtrType: Near64 (0xC) 127; CHECK: PtrMode: Pointer (0x0) 128; CHECK: IsFlat: 0 129; CHECK: IsConst: 0 130; CHECK: IsVolatile: 1 131; CHECK: IsUnaligned: 0 132; CHECK: IsRestrict: 1 133; CHECK: SizeOf: 8 134; CHECK: } 135; CHECK: FieldList (0x1009) { 136; CHECK: TypeLeafKind: LF_FIELDLIST (0x1203) 137; CHECK: DataMember { 138; CHECK: TypeLeafKind: LF_MEMBER (0x150D) 139; CHECK: AccessSpecifier: Public (0x3) 140; CHECK: Type: int* __restrict (0x1006) 141; CHECK: FieldOffset: 0x0 142; CHECK: Name: x_member 143; CHECK: } 144; CHECK: DataMember { 145; CHECK: TypeLeafKind: LF_MEMBER (0x150D) 146; CHECK: AccessSpecifier: Public (0x3) 147; CHECK: Type: float* __restrict (0x1007) 148; CHECK: FieldOffset: 0x0 149; CHECK: Name: y_member 150; CHECK: } 151; CHECK: DataMember { 152; CHECK: TypeLeafKind: LF_MEMBER (0x150D) 153; CHECK: AccessSpecifier: Public (0x3) 154; CHECK: Type: int* volatile __restrict (0x1008) 155; CHECK: FieldOffset: 0x0 156; CHECK: Name: m_volatile 157; CHECK: } 158; CHECK: } 159 160; CHECK: Modifier (0x100D) { 161; CHECK: TypeLeafKind: LF_MODIFIER (0x1001) 162; CHECK: ModifiedType: int (0x74) 163; CHECK: Modifiers [ (0x1) 164; CHECK: Const (0x1) 165; CHECK: ] 166; CHECK: } 167; CHECK: Pointer (0x100E) { 168; CHECK: TypeLeafKind: LF_POINTER (0x1002) 169; CHECK: PointeeType: const int (0x100D) 170; CHECK: PtrType: Near64 (0xC) 171; CHECK: PtrMode: Pointer (0x0) 172; CHECK: IsFlat: 0 173; CHECK: IsConst: 0 174; CHECK: IsVolatile: 0 175; CHECK: IsUnaligned: 0 176; CHECK: IsRestrict: 0 177; CHECK: SizeOf: 8 178; CHECK: } 179; CHECK: Pointer (0x100F) { 180; CHECK: TypeLeafKind: LF_POINTER (0x1002) 181; CHECK: PointeeType: int (0x74) 182; CHECK: PtrType: Near64 (0xC) 183; CHECK: PtrMode: LValueReference (0x1) 184; CHECK: IsFlat: 0 185; CHECK: IsConst: 0 186; CHECK: IsVolatile: 0 187; CHECK: IsUnaligned: 0 188; CHECK: IsRestrict: 1 189; CHECK: SizeOf: 8 190; CHECK: } 191; CHECK: ArgList (0x1010) { 192; CHECK: TypeLeafKind: LF_ARGLIST (0x1201) 193; CHECK: NumArgs: 1 194; CHECK: Arguments [ 195; CHECK: ArgType: int& __restrict (0x100F) 196; CHECK: ] 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: 1 205; CHECK: ArgListType: (int& __restrict) (0x1010) 206; CHECK: } 207; CHECK: FuncId (0x1012) { 208; CHECK: TypeLeafKind: LF_FUNC_ID (0x1601) 209; CHECK: ParentScope: 0x0 210; CHECK: FunctionType: void (int& __restrict) (0x1011) 211; CHECK: Name: g 212; CHECK: } 213; CHECK: Modifier (0x1013) { 214; CHECK: TypeLeafKind: LF_MODIFIER (0x1001) 215; CHECK: ModifiedType: char (0x70) 216; CHECK: Modifiers [ (0x1) 217; CHECK: Const (0x1) 218; CHECK: ] 219; CHECK: } 220; CHECK: Array (0x1014) { 221; CHECK: TypeLeafKind: LF_ARRAY (0x1503) 222; CHECK: ElementType: const char (0x1013) 223; CHECK: IndexType: unsigned __int64 (0x23) 224; CHECK: SizeOf: 4 225; CHECK: Name: 226; CHECK: } 227; CHECK: ArgList (0x1015) { 228; CHECK: TypeLeafKind: LF_ARGLIST (0x1201) 229; CHECK: NumArgs: 0 230; CHECK: Arguments [ 231; CHECK: ] 232; CHECK: } 233; CHECK: Procedure (0x1016) { 234; CHECK: TypeLeafKind: LF_PROCEDURE (0x1008) 235; CHECK: ReturnType: void (0x3) 236; CHECK: CallingConvention: NearC (0x0) 237; CHECK: FunctionOptions [ (0x0) 238; CHECK: ] 239; CHECK: NumParameters: 0 240; CHECK: ArgListType: () (0x1015) 241; CHECK: } 242; CHECK: FuncId (0x1017) { 243; CHECK: TypeLeafKind: LF_FUNC_ID (0x1601) 244; CHECK: ParentScope: 0x0 245; CHECK: FunctionType: void () (0x1016) 246; CHECK: Name: h 247; CHECK: } 248; CHECK: Struct (0x1018) { 249; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505) 250; CHECK: MemberCount: 0 251; CHECK: Properties [ (0x180) 252; CHECK: ForwardReference (0x80) 253; CHECK: Scoped (0x100) 254; CHECK: ] 255; CHECK: FieldList: 0x0 256; CHECK: DerivedFrom: 0x0 257; CHECK: VShape: 0x0 258; CHECK: SizeOf: 0 259; CHECK: Name: h::Foo 260; CHECK: } 261; CHECK: Pointer (0x1019) { 262; CHECK: TypeLeafKind: LF_POINTER (0x1002) 263; CHECK: PointeeType: h::Foo (0x1018) 264; CHECK: PtrType: Near64 (0xC) 265; CHECK: PtrMode: Pointer (0x0) 266; CHECK: IsFlat: 0 267; CHECK: IsConst: 1 268; CHECK: IsVolatile: 0 269; CHECK: IsUnaligned: 0 270; CHECK: IsRestrict: 0 271; CHECK: SizeOf: 8 272; CHECK: } 273; CHECK: ArgList (0x101A) { 274; CHECK: TypeLeafKind: LF_ARGLIST (0x1201) 275; CHECK: NumArgs: 1 276; CHECK: Arguments [ 277; CHECK: ArgType: int (0x74) 278; CHECK: ] 279; CHECK: } 280; CHECK: MemberFunction (0x101B) { 281; CHECK: TypeLeafKind: LF_MFUNCTION (0x1009) 282; CHECK: ReturnType: int (0x74) 283; CHECK: ClassType: h::Foo (0x1018) 284; CHECK: ThisType: h::Foo* const (0x1019) 285; CHECK: CallingConvention: NearC (0x0) 286; CHECK: FunctionOptions [ (0x0) 287; CHECK: ] 288; CHECK: NumParameters: 1 289; CHECK: ArgListType: (int) (0x101A) 290; CHECK: ThisAdjustment: 0 291; CHECK: } 292; CHECK: FieldList (0x101C) { 293; CHECK: TypeLeafKind: LF_FIELDLIST (0x1203) 294; CHECK: DataMember { 295; CHECK: TypeLeafKind: LF_MEMBER (0x150D) 296; CHECK: AccessSpecifier: Public (0x3) 297; CHECK: Type: int (0x74) 298; CHECK: FieldOffset: 0x0 299; CHECK: Name: a 300; CHECK: } 301; CHECK: OneMethod { 302; CHECK: TypeLeafKind: LF_ONEMETHOD (0x1511) 303; CHECK: AccessSpecifier: Public (0x3) 304; CHECK: Type: int h::Foo::(int) (0x101B) 305; CHECK: Name: func 306; CHECK: } 307; CHECK: } 308; CHECK: Struct (0x101D) { 309; CHECK: TypeLeafKind: LF_STRUCTURE (0x1505) 310; CHECK: MemberCount: 2 311; CHECK: Properties [ (0x100) 312; CHECK: Scoped (0x100) 313; CHECK: ] 314; CHECK: FieldList: <field list> (0x101C) 315; CHECK: DerivedFrom: 0x0 316; CHECK: VShape: 0x0 317; CHECK: SizeOf: 4 318; CHECK: Name: h::Foo 319; CHECK: } 320 321; CHECK: Pointer (0x101F) { 322; CHECK: TypeLeafKind: LF_POINTER (0x1002) 323; CHECK: PointeeType: int (0x74) 324; CHECK: PtrType: Near64 (0xC) 325; CHECK: PtrMode: PointerToDataMember (0x2) 326; CHECK: IsFlat: 0 327; CHECK: IsConst: 0 328; CHECK: IsVolatile: 0 329; CHECK: IsUnaligned: 0 330; CHECK: IsRestrict: 1 331; CHECK: SizeOf: 4 332; CHECK: ClassType: h::Foo (0x1018) 333; CHECK: Representation: SingleInheritanceData (0x1) 334; CHECK: } 335; CHECK: Pointer (0x1020) { 336; CHECK: TypeLeafKind: LF_POINTER (0x1002) 337; CHECK: PointeeType: int h::Foo::(int) (0x101B) 338; CHECK: PtrType: Near64 (0xC) 339; CHECK: PtrMode: PointerToMemberFunction (0x3) 340; CHECK: IsFlat: 0 341; CHECK: IsConst: 0 342; CHECK: IsVolatile: 0 343; CHECK: IsUnaligned: 0 344; CHECK: IsRestrict: 0 345; CHECK: SizeOf: 8 346; CHECK: ClassType: h::Foo (0x1018) 347; CHECK: Representation: SingleInheritanceFunction (0x5) 348; CHECK: } 349; CHECK: MemberFuncId (0x1021) { 350; CHECK: TypeLeafKind: LF_MFUNC_ID (0x1602) 351; CHECK: ClassType: h::Foo (0x1018) 352; CHECK: FunctionType: int h::Foo::(int) (0x101B) 353; CHECK: Name: func 354; CHECK: } 355; CHECK: Pointer (0x1022) { 356; CHECK: TypeLeafKind: LF_POINTER (0x1002) 357; CHECK: PointeeType: h::Foo (0x1018) 358; CHECK: PtrType: Near64 (0xC) 359; CHECK: PtrMode: Pointer (0x0) 360; CHECK: IsFlat: 0 361; CHECK: IsConst: 0 362; CHECK: IsVolatile: 0 363; CHECK: IsUnaligned: 0 364; CHECK: IsRestrict: 0 365; CHECK: SizeOf: 8 366; CHECK: } 367; CHECK: ] 368 369; CHECK-LABEL: CodeViewDebugInfo [ 370; CHECK-NEXT: Section: .debug$S (6) 371; CHECK: Subsection [ 372; CHECK: SubSectionType: Symbols (0xF1) 373; CHECK: GlobalProcIdSym { 374; CHECK: Kind: S_GPROC32_ID (0x1147) 375; CHECK: FunctionType: f ({{.*}}) 376; CHECK: CodeOffset: ?f@@YAHPEIDH@Z+0x0 377; CHECK: DisplayName: f 378; CHECK: LinkageName: ?f@@YAHPEIDH@Z 379; CHECK: } 380; CHECK: LocalSym { 381; CHECK: Kind: S_LOCAL (0x113E) 382; CHECK: Type: const volatile int* __restrict (0x1001) 383; CHECK: VarName: arg_crv 384; CHECK: } 385; CHECK: LocalSym { 386; CHECK: Kind: S_LOCAL (0x113E) 387; CHECK: Type: Union (0x100A) 388; CHECK: VarName: u 389; CHECK: } 390; CHECK: LocalSym { 391; CHECK: Kind: S_LOCAL (0x113E) 392; CHECK: Type: const int* (0x100E) 393; CHECK: VarName: p 394; CHECK: } 395; CHECK: LocalSym { 396; CHECK: Kind: S_LOCAL (0x113E) 397; CHECK: Type: const volatile int (0x1000) 398; CHECK: VarName: v 399; CHECK: } 400 401; ModuleID = 'm.cpp' 402source_filename = "m.cpp" 403target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128" 404target triple = "x86_64-pc-windows-msvc19.11.25507" 405 406%struct.Foo = type { i32 } 407%union.Union = type { i32* } 408 409@"\01?str@?1??g@@YAXAEIAH@Z@3QBDB" = internal constant [4 x i8] c"abc\00", align 1, !dbg !0 410@"\01?s@?1??h@@YAXXZ@3UFoo@?1??1@YAXXZ@A" = private unnamed_addr constant %struct.Foo { i32 10 }, align 4 411 412; Function Attrs: noinline nounwind optnone uwtable 413define i32 @"\01?f@@YAHPEIDH@Z"(i32* noalias %arg_crv) #0 !dbg !22 { 414entry: 415 %arg_crv.addr = alloca i32*, align 8 416 %u = alloca %union.Union, align 8 417 %p = alloca i32*, align 8 418 %v = alloca i32, align 4 419 store i32* %arg_crv, i32** %arg_crv.addr, align 8 420 call void @llvm.dbg.declare(metadata i32** %arg_crv.addr, metadata !29, metadata !DIExpression()), !dbg !30 421 call void @llvm.dbg.declare(metadata %union.Union* %u, metadata !31, metadata !DIExpression()), !dbg !43 422 call void @llvm.dbg.declare(metadata i32** %p, metadata !44, metadata !DIExpression()), !dbg !47 423 call void @llvm.dbg.declare(metadata i32* %v, metadata !48, metadata !DIExpression()), !dbg !49 424 store volatile i32 0, i32* %v, align 4, !dbg !49 425 ret i32 1, !dbg !50 426} 427 428; Function Attrs: nounwind readnone speculatable 429declare void @llvm.dbg.declare(metadata, metadata, metadata) #1 430 431; Function Attrs: noinline nounwind optnone uwtable 432define void @"\01?g@@YAXAEIAH@Z"(i32* noalias dereferenceable(4) %arg_ref) #0 !dbg !2 { 433entry: 434 %arg_ref.addr = alloca i32*, align 8 435 %x = alloca i32, align 4 436 store i32* %arg_ref, i32** %arg_ref.addr, align 8 437 call void @llvm.dbg.declare(metadata i32** %arg_ref.addr, metadata !51, metadata !DIExpression()), !dbg !52 438 call void @llvm.dbg.declare(metadata i32* %x, metadata !53, metadata !DIExpression()), !dbg !54 439 store i32 10, i32* %x, align 4, !dbg !54 440 ret void, !dbg !55 441} 442 443; Function Attrs: noinline nounwind optnone uwtable 444define void @"\01?h@@YAXXZ"() #0 !dbg !56 { 445entry: 446 %s = alloca %struct.Foo, align 4 447 %p_object = alloca i32*, align 8 448 %p_data_member = alloca i32, align 8 449 %p_member_func = alloca i8*, align 8 450 call void @llvm.dbg.declare(metadata %struct.Foo* %s, metadata !59, metadata !DIExpression()), !dbg !68 451 %0 = bitcast %struct.Foo* %s to i8*, !dbg !68 452 call void @llvm.memcpy.p0i8.p0i8.i64(i8* align 4 %0, i8* align 4 bitcast (%struct.Foo* @"\01?s@?1??h@@YAXXZ@3UFoo@?1??1@YAXXZ@A" to i8*), i64 4, i1 false), !dbg !68 453 call void @llvm.dbg.declare(metadata i32** %p_object, metadata !69, metadata !DIExpression()), !dbg !70 454 %a = getelementptr inbounds %struct.Foo, %struct.Foo* %s, i32 0, i32 0, !dbg !71 455 store i32* %a, i32** %p_object, align 8, !dbg !70 456 call void @llvm.dbg.declare(metadata i32* %p_data_member, metadata !72, metadata !DIExpression()), !dbg !75 457 store i32 0, i32* %p_data_member, align 8, !dbg !75 458 call void @llvm.dbg.declare(metadata i8** %p_member_func, metadata !76, metadata !DIExpression()), !dbg !78 459 store i8* bitcast (i32 (%struct.Foo*, i32)* @"\01?func@Foo@?1??h@@YAXXZ@QEIAAHH@Z" to i8*), i8** %p_member_func, align 8, !dbg !78 460 ret void, !dbg !79 461} 462 463; Function Attrs: argmemonly nounwind 464declare void @llvm.memcpy.p0i8.p0i8.i64(i8* nocapture writeonly, i8* nocapture readonly, i64, i1) #2 465 466; Function Attrs: noinline nounwind optnone uwtable 467define internal i32 @"\01?func@Foo@?1??h@@YAXXZ@QEIAAHH@Z"(%struct.Foo* %this, i32 %x) #0 align 2 !dbg !80 { 468entry: 469 %x.addr = alloca i32, align 4 470 %this.addr = alloca %struct.Foo*, align 8 471 store i32 %x, i32* %x.addr, align 4 472 call void @llvm.dbg.declare(metadata i32* %x.addr, metadata !81, metadata !DIExpression()), !dbg !82 473 store %struct.Foo* %this, %struct.Foo** %this.addr, align 8 474 call void @llvm.dbg.declare(metadata %struct.Foo** %this.addr, metadata !83, metadata !DIExpression()), !dbg !85 475 %this1 = load %struct.Foo*, %struct.Foo** %this.addr, align 8 476 ret i32 1, !dbg !86 477} 478 479attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "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" "no-signed-zeros-fp-math"="false" "no-trapping-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" } 480attributes #1 = { nounwind readnone speculatable } 481attributes #2 = { argmemonly nounwind } 482 483!llvm.dbg.cu = !{!9} 484!llvm.module.flags = !{!17, !18, !19, !20} 485!llvm.ident = !{!21} 486 487!0 = !DIGlobalVariableExpression(var: !1, expr: !DIExpression()) 488!1 = distinct !DIGlobalVariable(name: "str", scope: !2, file: !3, line: 18, type: !12, isLocal: true, isDefinition: true) 489!2 = distinct !DISubprogram(name: "g", linkageName: "\01?g@@YAXAEIAH@Z", scope: !3, file: !3, line: 16, type: !4, isLocal: false, isDefinition: true, scopeLine: 16, flags: DIFlagPrototyped, isOptimized: false, unit: !9, retainedNodes: !10) 490!3 = !DIFile(filename: "m.cpp", directory: "C:\5CUsers\5CHui\5Ctmp\5Chui", checksumkind: CSK_MD5, checksum: "a8da0f4dca948db1ef1129c8728a881c") 491!4 = !DISubroutineType(types: !5) 492!5 = !{null, !6} 493!6 = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !7) 494!7 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !8, size: 64) 495!8 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed) 496!9 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !3, producer: "clang version 7.0.0 ", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !10, globals: !11) 497!10 = !{} 498!11 = !{!0} 499!12 = !DICompositeType(tag: DW_TAG_array_type, baseType: !13, size: 32, elements: !15) 500!13 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !14) 501!14 = !DIBasicType(name: "char", size: 8, encoding: DW_ATE_signed_char) 502!15 = !{!16} 503!16 = !DISubrange(count: 4) 504!17 = !{i32 2, !"CodeView", i32 1} 505!18 = !{i32 2, !"Debug Info Version", i32 3} 506!19 = !{i32 1, !"wchar_size", i32 2} 507!20 = !{i32 7, !"PIC Level", i32 2} 508!21 = !{!"clang version 7.0.0 "} 509!22 = distinct !DISubprogram(name: "f", linkageName: "\01?f@@YAHPEIDH@Z", scope: !3, file: !3, line: 9, type: !23, isLocal: false, isDefinition: true, scopeLine: 9, flags: DIFlagPrototyped, isOptimized: false, unit: !9, retainedNodes: !10) 510!23 = !DISubroutineType(types: !24) 511!24 = !{!8, !25} 512!25 = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !26) 513!26 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !27, size: 64) 514!27 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !28) 515!28 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !8) 516!29 = !DILocalVariable(name: "arg_crv", arg: 1, scope: !22, file: !3, line: 9, type: !25) 517!30 = !DILocation(line: 9, column: 39, scope: !22) 518!31 = !DILocalVariable(name: "u", scope: !22, file: !3, line: 10, type: !32) 519!32 = distinct !DICompositeType(tag: DW_TAG_union_type, name: "Union", file: !3, line: 3, size: 64, flags: DIFlagTypePassByValue, elements: !33, identifier: ".?ATUnion@@") 520!33 = !{!34, !37, !41} 521!34 = !DIDerivedType(tag: DW_TAG_member, name: "x_member", scope: !32, file: !3, line: 4, baseType: !35, size: 64) 522!35 = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !36) 523!36 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !8, size: 64) 524!37 = !DIDerivedType(tag: DW_TAG_member, name: "y_member", scope: !32, file: !3, line: 5, baseType: !38, size: 64) 525!38 = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !39) 526!39 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !40, size: 64) 527!40 = !DIBasicType(name: "float", size: 32, encoding: DW_ATE_float) 528!41 = !DIDerivedType(tag: DW_TAG_member, name: "m_volatile", scope: !32, file: !3, line: 6, baseType: !42, size: 64) 529!42 = !DIDerivedType(tag: DW_TAG_volatile_type, baseType: !35) 530!43 = !DILocation(line: 10, column: 10, scope: !22) 531!44 = !DILocalVariable(name: "p", scope: !22, file: !3, line: 11, type: !45) 532!45 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !46, size: 64) 533!46 = !DIDerivedType(tag: DW_TAG_const_type, baseType: !8) 534!47 = !DILocation(line: 11, column: 15, scope: !22) 535!48 = !DILocalVariable(name: "v", scope: !22, file: !3, line: 12, type: !27) 536!49 = !DILocation(line: 12, column: 23, scope: !22) 537!50 = !DILocation(line: 13, column: 4, scope: !22) 538!51 = !DILocalVariable(name: "arg_ref", arg: 1, scope: !2, file: !3, line: 16, type: !6) 539!52 = !DILocation(line: 16, column: 25, scope: !2) 540!53 = !DILocalVariable(name: "x", scope: !2, file: !3, line: 17, type: !46) 541!54 = !DILocation(line: 17, column: 14, scope: !2) 542!55 = !DILocation(line: 19, column: 2, scope: !2) 543!56 = distinct !DISubprogram(name: "h", linkageName: "\01?h@@YAXXZ", scope: !3, file: !3, line: 21, type: !57, isLocal: false, isDefinition: true, scopeLine: 21, flags: DIFlagPrototyped, isOptimized: false, unit: !9, retainedNodes: !10) 544!57 = !DISubroutineType(types: !58) 545!58 = !{null} 546!59 = !DILocalVariable(name: "s", scope: !56, file: !3, line: 27, type: !60) 547!60 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "Foo", scope: !56, file: !3, line: 22, size: 32, flags: DIFlagTypePassByValue, elements: !61) 548!61 = !{!62, !63} 549!62 = !DIDerivedType(tag: DW_TAG_member, name: "a", scope: !60, file: !3, line: 23, baseType: !8, size: 32) 550!63 = !DISubprogram(name: "func", scope: !60, file: !3, line: 24, type: !64, isLocal: false, isDefinition: false, scopeLine: 24, flags: DIFlagPrototyped, isOptimized: false) 551!64 = !DISubroutineType(types: !65) 552!65 = !{!8, !66, !8} 553 554; FIXME: Clang emits wrong debug info here because of PR17747. We should 555; regenerate this IR when it is fixed. 556!66 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !67, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer) 557!67 = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !60) 558 559!68 = !DILocation(line: 27, column: 8, scope: !56) 560!69 = !DILocalVariable(name: "p_object", scope: !56, file: !3, line: 29, type: !35) 561!70 = !DILocation(line: 29, column: 20, scope: !56) 562!71 = !DILocation(line: 29, column: 34, scope: !56) 563!72 = !DILocalVariable(name: "p_data_member", scope: !56, file: !3, line: 31, type: !73) 564!73 = !DIDerivedType(tag: DW_TAG_restrict_type, baseType: !74) 565!74 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !8, size: 32, flags: DIFlagSingleInheritance, extraData: !60) 566!75 = !DILocation(line: 31, column: 27, scope: !56) 567!76 = !DILocalVariable(name: "p_member_func", scope: !56, file: !3, line: 33, type: !77) 568!77 = !DIDerivedType(tag: DW_TAG_ptr_to_member_type, baseType: !64, size: 64, flags: DIFlagSingleInheritance, extraData: !60) 569!78 = !DILocation(line: 33, column: 16, scope: !56) 570!79 = !DILocation(line: 34, column: 2, scope: !56) 571!80 = distinct !DISubprogram(name: "func", linkageName: "\01?func@Foo@?1??h@@YAXXZ@QEIAAHH@Z", scope: !60, file: !3, line: 24, type: !64, isLocal: true, isDefinition: true, scopeLine: 24, flags: DIFlagPrototyped, isOptimized: false, unit: !9, declaration: !63, retainedNodes: !10) 572!81 = !DILocalVariable(name: "x", arg: 2, scope: !80, file: !3, line: 24, type: !8) 573!82 = !DILocation(line: 24, column: 19, scope: !80) 574!83 = !DILocalVariable(name: "this", arg: 1, scope: !80, type: !84, flags: DIFlagArtificial | DIFlagObjectPointer) 575!84 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !67, size: 64) 576!85 = !DILocation(line: 0, scope: !80) 577!86 = !DILocation(line: 24, column: 35, scope: !80) 578