akhuang updated this revision to Diff 247104.
akhuang added a comment.

Just change CodeViewDebug to add CxxReturnUdt to all methods that return a 
record type,
which appears to be consistent with what msvc does and avoids emitting two 
versions of
the method in the pdb file.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D75215/new/

https://reviews.llvm.org/D75215

Files:
  llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
  llvm/test/DebugInfo/COFF/function-options.ll

Index: llvm/test/DebugInfo/COFF/function-options.ll
===================================================================
--- llvm/test/DebugInfo/COFF/function-options.ll
+++ llvm/test/DebugInfo/COFF/function-options.ll
@@ -33,7 +33,15 @@
 ; DEFINE_FUNCTION(DClass); // Expect: FO = CxxReturnUdt
 ;
 ; class FClass { static int x; };
-; DEFINE_FUNCTION(FClass); // Expect FO = None
+; DEFINE_FUNCTION(FClass); // Expect: FO = None
+;
+; class GClass;
+; class HClass {
+;   AClass Member_AClass(AClass &); // Expect: FO = CxxReturnUdt
+;   BClass Member_BClass(BClass &); // Expect: FO = CxxReturnUdt
+;   GClass Member_GClass(GClass &); // Expect: FO = CxxReturnUdt
+; }
+; DEFINE_FUNCTION(HClass);
 ; 
 ; struct AStruct {};
 ; DEFINE_FUNCTION(AStruct); // Expect FO = None
@@ -229,6 +237,66 @@
 ; CHECK:     FunctionType: FClass (FClass&) ([[SP6]])
 ; CHECK:     Name: Func_FClass
 ; CHECK:   }
+; CHECK:   MemberFunction ([[MF_A:.*]]) {
+; CHECK:     TypeLeafKind: LF_MFUNCTION (0x1009)
+; CHECK:     ReturnType: AClass ({{.*}})
+; CHECK:     ClassType: HClass ({{.*}})
+; CHECK:     ThisType: HClass* const ({{.*}})
+; CHECK:     CallingConvention: NearC (0x0)
+; CHECK:     FunctionOptions [ (0x1)
+; CHECK:       CxxReturnUdt (0x1)
+; CHECK:     ]
+; CHECK:     NumParameters: 1
+; CHECK:     ArgListType: (AClass&) ({{.*}})
+; CHECK:     ThisAdjustment: 0
+; CHECK:   }
+; CHECK:   MemberFunction ([[MF_B:.*]]) {
+; CHECK:     TypeLeafKind: LF_MFUNCTION (0x1009)
+; CHECK:     ReturnType: BClass ({{.*}})
+; CHECK:     ClassType: HClass ({{.*}})
+; CHECK:     ThisType: HClass* const ({{.*}})
+; CHECK:     CallingConvention: NearC (0x0)
+; CHECK:     FunctionOptions [ (0x1)
+; CHECK:       CxxReturnUdt (0x1)
+; CHECK:     ]
+; CHECK:     NumParameters: 1
+; CHECK:     ArgListType: (BClass&) ({{.*}})
+; CHECK:     ThisAdjustment: 0
+; CHECK:   }
+; CHECK:   MemberFunction ([[MF_G:.*]]) {
+; CHECK:     TypeLeafKind: LF_MFUNCTION (0x1009)
+; CHECK:     ReturnType: GClass ({{.*}})
+; CHECK:     ClassType: HClass ({{.*}})
+; CHECK:     ThisType: HClass* const ({{.*}})
+; CHECK:     CallingConvention: NearC (0x0)
+; CHECK:     FunctionOptions [ (0x1)
+; CHECK:       CxxReturnUdt (0x1)
+; CHECK:     ]
+; CHECK:     NumParameters: 1
+; CHECK:     ArgListType: (GClass&) ({{.*}})
+; CHECK:     ThisAdjustment: 0
+; CHECK:   }
+; CHECK:   FieldList (0x1043) {
+; CHECK:     TypeLeafKind: LF_FIELDLIST (0x1203)
+; CHECK:     OneMethod {
+; CHECK:       TypeLeafKind: LF_ONEMETHOD (0x1511)
+; CHECK:       AccessSpecifier: Private (0x1)
+; CHECK:       Type: AClass HClass::(AClass&) ([[MF_A]])
+; CHECK:       Name: Member_AClass
+; CHECK:     }
+; CHECK:     OneMethod {
+; CHECK:       TypeLeafKind: LF_ONEMETHOD (0x1511)
+; CHECK:       AccessSpecifier: Private (0x1)
+; CHECK:       Type: BClass HClass::(BClass&) ([[MF_B]])
+; CHECK:       Name: Member_BClass
+; CHECK:     }
+; CHECK:     OneMethod {
+; CHECK:       TypeLeafKind: LF_ONEMETHOD (0x1511)
+; CHECK:       AccessSpecifier: Private (0x1)
+; CHECK:       Type: GClass HClass::(GClass&) ([[MF_G]])
+; CHECK:       Name: Member_GClass
+; CHECK:     }
+; CHECK:   }
 ; CHECK:   Procedure ([[SP7:.*]]) {
 ; CHECK:     TypeLeafKind: LF_PROCEDURE (0x1008)
 ; CHECK:     ReturnType: AStruct ({{.*}})
@@ -335,11 +403,10 @@
 ; CHECK:   }
 ; CHECK: ]
 
-
 ; ModuleID = 'function-options.cpp'
 source_filename = "function-options.cpp"
-target datalayout = "e-m:w-i64:64-f80:128-n8:16:32:64-S128"
-target triple = "x86_64-pc-windows-msvc19.15.26729"
+target datalayout = "e-m:w-p270:32:32-p271:32:32-p272:64:64-i64:64-f80:128-n8:16:32:64-S128"
+target triple = "x86_64-pc-windows-msvc19.23.28106"
 
 %class.AClass = type { i8 }
 %class.BClass = type { i8 }
@@ -347,6 +414,7 @@
 %class.C2Class = type { i8 }
 %class.DClass = type { i8 }
 %class.FClass = type { i8 }
+%class.HClass = type { i8 }
 %struct.AStruct = type { i8 }
 %struct.BStruct = type { i8 }
 %union.AUnion = type { i8 }
@@ -358,228 +426,278 @@
   %retval = alloca %class.AClass, align 1
   %arg.addr = alloca %class.AClass*, align 8
   store %class.AClass* %arg, %class.AClass** %arg.addr, align 8
-  call void @llvm.dbg.declare(metadata %class.AClass** %arg.addr, metadata !14, metadata !DIExpression()), !dbg !15
-  %0 = load %class.AClass*, %class.AClass** %arg.addr, align 8, !dbg !15
-  %coerce.dive = getelementptr inbounds %class.AClass, %class.AClass* %retval, i32 0, i32 0, !dbg !15
-  %1 = load i8, i8* %coerce.dive, align 1, !dbg !15
-  ret i8 %1, !dbg !15
+  call void @llvm.dbg.declare(metadata %class.AClass** %arg.addr, metadata !13, metadata !DIExpression()), !dbg !14
+  %0 = load %class.AClass*, %class.AClass** %arg.addr, align 8, !dbg !14
+  %coerce.dive = getelementptr inbounds %class.AClass, %class.AClass* %retval, i32 0, i32 0, !dbg !14
+  %1 = load i8, i8* %coerce.dive, align 1, !dbg !14
+  ret i8 %1, !dbg !14
 }
 
-; Function Attrs: nounwind readnone speculatable
+; Function Attrs: nounwind readnone speculatable willreturn
 declare void @llvm.dbg.declare(metadata, metadata, metadata) #1
 
 ; Function Attrs: noinline nounwind optnone uwtable
-define dso_local void @"?Func_BClass@@YA?AVBClass@@AEAV1@@Z"(%class.BClass* noalias sret %agg.result, %class.BClass* dereferenceable(1) %arg) #0 !dbg !16 {
+define dso_local void @"?Func_BClass@@YA?AVBClass@@AEAV1@@Z"(%class.BClass* noalias sret %agg.result, %class.BClass* dereferenceable(1) %arg) #0 !dbg !15 {
 entry:
+  %result.ptr = alloca i8*, align 8
   %arg.addr = alloca %class.BClass*, align 8
+  %0 = bitcast %class.BClass* %agg.result to i8*
+  store i8* %0, i8** %result.ptr, align 8
   store %class.BClass* %arg, %class.BClass** %arg.addr, align 8
-  call void @llvm.dbg.declare(metadata %class.BClass** %arg.addr, metadata !26, metadata !DIExpression()), !dbg !27
-  %0 = load %class.BClass*, %class.BClass** %arg.addr, align 8, !dbg !27
-  ret void, !dbg !27
+  call void @llvm.dbg.declare(metadata %class.BClass** %arg.addr, metadata !25, metadata !DIExpression()), !dbg !26
+  %1 = load %class.BClass*, %class.BClass** %arg.addr, align 8, !dbg !26
+  ret void, !dbg !26
 }
 
 ; Function Attrs: noinline nounwind optnone uwtable
-define dso_local void @"?Func_C1Class@@YA?AVC1Class@@AEAV1@@Z"(%class.C1Class* noalias sret %agg.result, %class.C1Class* dereferenceable(1) %arg) #0 !dbg !28 {
+define dso_local void @"?Func_C1Class@@YA?AVC1Class@@AEAV1@@Z"(%class.C1Class* noalias sret %agg.result, %class.C1Class* dereferenceable(1) %arg) #0 !dbg !27 {
 entry:
+  %result.ptr = alloca i8*, align 8
   %arg.addr = alloca %class.C1Class*, align 8
+  %0 = bitcast %class.C1Class* %agg.result to i8*
+  store i8* %0, i8** %result.ptr, align 8
   store %class.C1Class* %arg, %class.C1Class** %arg.addr, align 8
-  call void @llvm.dbg.declare(metadata %class.C1Class** %arg.addr, metadata !38, metadata !DIExpression()), !dbg !39
-  %0 = load %class.C1Class*, %class.C1Class** %arg.addr, align 8, !dbg !39
-  ret void, !dbg !39
+  call void @llvm.dbg.declare(metadata %class.C1Class** %arg.addr, metadata !37, metadata !DIExpression()), !dbg !38
+  %1 = load %class.C1Class*, %class.C1Class** %arg.addr, align 8, !dbg !38
+  ret void, !dbg !38
 }
 
 ; Function Attrs: noinline nounwind optnone uwtable
-define dso_local void @"?Func_C2Class@@YA?AVC2Class@@AEAV1@@Z"(%class.C2Class* noalias sret %agg.result, %class.C2Class* dereferenceable(1) %arg) #0 !dbg !40 {
+define dso_local void @"?Func_C2Class@@YA?AVC2Class@@AEAV1@@Z"(%class.C2Class* noalias sret %agg.result, %class.C2Class* dereferenceable(1) %arg) #0 !dbg !39 {
 entry:
+  %result.ptr = alloca i8*, align 8
   %arg.addr = alloca %class.C2Class*, align 8
+  %0 = bitcast %class.C2Class* %agg.result to i8*
+  store i8* %0, i8** %result.ptr, align 8
   store %class.C2Class* %arg, %class.C2Class** %arg.addr, align 8
-  call void @llvm.dbg.declare(metadata %class.C2Class** %arg.addr, metadata !50, metadata !DIExpression()), !dbg !51
-  %0 = load %class.C2Class*, %class.C2Class** %arg.addr, align 8, !dbg !51
-  ret void, !dbg !51
+  call void @llvm.dbg.declare(metadata %class.C2Class** %arg.addr, metadata !49, metadata !DIExpression()), !dbg !50
+  %1 = load %class.C2Class*, %class.C2Class** %arg.addr, align 8, !dbg !50
+  ret void, !dbg !50
 }
 
 ; Function Attrs: noinline nounwind optnone uwtable
-define dso_local void @"?Func_DClass@@YA?AVDClass@@AEAV1@@Z"(%class.DClass* noalias sret %agg.result, %class.DClass* dereferenceable(1) %arg) #0 !dbg !52 {
+define dso_local void @"?Func_DClass@@YA?AVDClass@@AEAV1@@Z"(%class.DClass* noalias sret %agg.result, %class.DClass* dereferenceable(1) %arg) #0 !dbg !51 {
 entry:
+  %result.ptr = alloca i8*, align 8
   %arg.addr = alloca %class.DClass*, align 8
+  %0 = bitcast %class.DClass* %agg.result to i8*
+  store i8* %0, i8** %result.ptr, align 8
   store %class.DClass* %arg, %class.DClass** %arg.addr, align 8
-  call void @llvm.dbg.declare(metadata %class.DClass** %arg.addr, metadata !59, metadata !DIExpression()), !dbg !60
-  %0 = load %class.DClass*, %class.DClass** %arg.addr, align 8, !dbg !60
-  ret void, !dbg !60
+  call void @llvm.dbg.declare(metadata %class.DClass** %arg.addr, metadata !58, metadata !DIExpression()), !dbg !59
+  %1 = load %class.DClass*, %class.DClass** %arg.addr, align 8, !dbg !59
+  ret void, !dbg !59
 }
 
 ; Function Attrs: noinline nounwind optnone uwtable
-define dso_local i8 @"?Func_FClass@@YA?AVFClass@@AEAV1@@Z"(%class.FClass* dereferenceable(1) %arg) #0 !dbg !61 {
+define dso_local i8 @"?Func_FClass@@YA?AVFClass@@AEAV1@@Z"(%class.FClass* dereferenceable(1) %arg) #0 !dbg !60 {
 entry:
   %retval = alloca %class.FClass, align 1
   %arg.addr = alloca %class.FClass*, align 8
   store %class.FClass* %arg, %class.FClass** %arg.addr, align 8
-  call void @llvm.dbg.declare(metadata %class.FClass** %arg.addr, metadata !69, metadata !DIExpression()), !dbg !70
-  %0 = load %class.FClass*, %class.FClass** %arg.addr, align 8, !dbg !70
-  %coerce.dive = getelementptr inbounds %class.FClass, %class.FClass* %retval, i32 0, i32 0, !dbg !70
-  %1 = load i8, i8* %coerce.dive, align 1, !dbg !70
-  ret i8 %1, !dbg !70
+  call void @llvm.dbg.declare(metadata %class.FClass** %arg.addr, metadata !68, metadata !DIExpression()), !dbg !69
+  %0 = load %class.FClass*, %class.FClass** %arg.addr, align 8, !dbg !69
+  %coerce.dive = getelementptr inbounds %class.FClass, %class.FClass* %retval, i32 0, i32 0, !dbg !69
+  %1 = load i8, i8* %coerce.dive, align 1, !dbg !69
+  ret i8 %1, !dbg !69
+}
+
+; Function Attrs: noinline nounwind optnone uwtable
+define dso_local i8 @"?Func_HClass@@YA?AVHClass@@AEAV1@@Z"(%class.HClass* dereferenceable(1) %arg) #0 !dbg !70 {
+entry:
+  %retval = alloca %class.HClass, align 1
+  %arg.addr = alloca %class.HClass*, align 8
+  store %class.HClass* %arg, %class.HClass** %arg.addr, align 8
+  call void @llvm.dbg.declare(metadata %class.HClass** %arg.addr, metadata !88, metadata !DIExpression()), !dbg !89
+  %0 = load %class.HClass*, %class.HClass** %arg.addr, align 8, !dbg !89
+  %coerce.dive = getelementptr inbounds %class.HClass, %class.HClass* %retval, i32 0, i32 0, !dbg !89
+  %1 = load i8, i8* %coerce.dive, align 1, !dbg !89
+  ret i8 %1, !dbg !89
 }
 
 ; Function Attrs: noinline nounwind optnone uwtable
-define dso_local i8 @"?Func_AStruct@@YA?AUAStruct@@AEAU1@@Z"(%struct.AStruct* dereferenceable(1) %arg) #0 !dbg !71 {
+define dso_local i8 @"?Func_AStruct@@YA?AUAStruct@@AEAU1@@Z"(%struct.AStruct* dereferenceable(1) %arg) #0 !dbg !90 {
 entry:
   %retval = alloca %struct.AStruct, align 1
   %arg.addr = alloca %struct.AStruct*, align 8
   store %struct.AStruct* %arg, %struct.AStruct** %arg.addr, align 8
-  call void @llvm.dbg.declare(metadata %struct.AStruct** %arg.addr, metadata !76, metadata !DIExpression()), !dbg !77
-  %0 = load %struct.AStruct*, %struct.AStruct** %arg.addr, align 8, !dbg !77
-  %coerce.dive = getelementptr inbounds %struct.AStruct, %struct.AStruct* %retval, i32 0, i32 0, !dbg !77
-  %1 = load i8, i8* %coerce.dive, align 1, !dbg !77
-  ret i8 %1, !dbg !77
+  call void @llvm.dbg.declare(metadata %struct.AStruct** %arg.addr, metadata !95, metadata !DIExpression()), !dbg !96
+  %0 = load %struct.AStruct*, %struct.AStruct** %arg.addr, align 8, !dbg !96
+  %coerce.dive = getelementptr inbounds %struct.AStruct, %struct.AStruct* %retval, i32 0, i32 0, !dbg !96
+  %1 = load i8, i8* %coerce.dive, align 1, !dbg !96
+  ret i8 %1, !dbg !96
 }
 
 ; Function Attrs: noinline nounwind optnone uwtable
-define dso_local void @"?Func_BStruct@@YA?AUBStruct@@AEAU1@@Z"(%struct.BStruct* noalias sret %agg.result, %struct.BStruct* dereferenceable(1) %arg) #0 !dbg !78 {
+define dso_local void @"?Func_BStruct@@YA?AUBStruct@@AEAU1@@Z"(%struct.BStruct* noalias sret %agg.result, %struct.BStruct* dereferenceable(1) %arg) #0 !dbg !97 {
 entry:
+  %result.ptr = alloca i8*, align 8
   %arg.addr = alloca %struct.BStruct*, align 8
+  %0 = bitcast %struct.BStruct* %agg.result to i8*
+  store i8* %0, i8** %result.ptr, align 8
   store %struct.BStruct* %arg, %struct.BStruct** %arg.addr, align 8
-  call void @llvm.dbg.declare(metadata %struct.BStruct** %arg.addr, metadata !88, metadata !DIExpression()), !dbg !89
-  %0 = load %struct.BStruct*, %struct.BStruct** %arg.addr, align 8, !dbg !89
-  ret void, !dbg !89
+  call void @llvm.dbg.declare(metadata %struct.BStruct** %arg.addr, metadata !107, metadata !DIExpression()), !dbg !108
+  %1 = load %struct.BStruct*, %struct.BStruct** %arg.addr, align 8, !dbg !108
+  ret void, !dbg !108
 }
 
 ; Function Attrs: noinline nounwind optnone uwtable
-define dso_local i8 @"?Func_AUnion@@YA?ATAUnion@@AEAT1@@Z"(%union.AUnion* dereferenceable(1) %arg) #0 !dbg !90 {
+define dso_local i8 @"?Func_AUnion@@YA?ATAUnion@@AEAT1@@Z"(%union.AUnion* dereferenceable(1) %arg) #0 !dbg !109 {
 entry:
   %retval = alloca %union.AUnion, align 1
   %arg.addr = alloca %union.AUnion*, align 8
   store %union.AUnion* %arg, %union.AUnion** %arg.addr, align 8
-  call void @llvm.dbg.declare(metadata %union.AUnion** %arg.addr, metadata !95, metadata !DIExpression()), !dbg !96
-  %0 = load %union.AUnion*, %union.AUnion** %arg.addr, align 8, !dbg !96
-  %coerce.dive = getelementptr inbounds %union.AUnion, %union.AUnion* %retval, i32 0, i32 0, !dbg !96
-  %1 = load i8, i8* %coerce.dive, align 1, !dbg !96
-  ret i8 %1, !dbg !96
+  call void @llvm.dbg.declare(metadata %union.AUnion** %arg.addr, metadata !114, metadata !DIExpression()), !dbg !115
+  %0 = load %union.AUnion*, %union.AUnion** %arg.addr, align 8, !dbg !115
+  %coerce.dive = getelementptr inbounds %union.AUnion, %union.AUnion* %retval, i32 0, i32 0, !dbg !115
+  %1 = load i8, i8* %coerce.dive, align 1, !dbg !115
+  ret i8 %1, !dbg !115
 }
 
 ; Function Attrs: noinline nounwind optnone uwtable
-define dso_local void @"?Func_BUnion@@YA?ATBUnion@@AEAT1@@Z"(%union.BUnion* noalias sret %agg.result, %union.BUnion* dereferenceable(1) %arg) #0 !dbg !97 {
+define dso_local void @"?Func_BUnion@@YA?ATBUnion@@AEAT1@@Z"(%union.BUnion* noalias sret %agg.result, %union.BUnion* dereferenceable(1) %arg) #0 !dbg !116 {
 entry:
+  %result.ptr = alloca i8*, align 8
   %arg.addr = alloca %union.BUnion*, align 8
+  %0 = bitcast %union.BUnion* %agg.result to i8*
+  store i8* %0, i8** %result.ptr, align 8
   store %union.BUnion* %arg, %union.BUnion** %arg.addr, align 8
-  call void @llvm.dbg.declare(metadata %union.BUnion** %arg.addr, metadata !107, metadata !DIExpression()), !dbg !108
-  %0 = load %union.BUnion*, %union.BUnion** %arg.addr, align 8, !dbg !108
-  ret void, !dbg !108
+  call void @llvm.dbg.declare(metadata %union.BUnion** %arg.addr, metadata !126, metadata !DIExpression()), !dbg !127
+  %1 = load %union.BUnion*, %union.BUnion** %arg.addr, align 8, !dbg !127
+  ret void, !dbg !127
 }
 
-attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "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" }
-attributes #1 = { nounwind readnone speculatable }
+attributes #0 = { noinline nounwind optnone uwtable "correctly-rounded-divide-sqrt-fp-math"="false" "disable-tail-calls"="false" "frame-pointer"="none" "less-precise-fpmad"="false" "min-legal-vector-width"="0" "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"="+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "unsafe-fp-math"="false" "use-soft-float"="false" }
+attributes #1 = { nounwind readnone speculatable willreturn }
 
 !llvm.dbg.cu = !{!0}
 !llvm.module.flags = !{!3, !4, !5, !6}
 !llvm.ident = !{!7}
 
-!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus, file: !1, producer: "clang version 8.0.0", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
-!1 = !DIFile(filename: "function-options.cpp", directory: "\5Ctest\5CDebugInfo\5CCOFF", checksumkind: CSK_MD5, checksum: "e73e74ea0bd81174051f0a4746343e00")
+!0 = distinct !DICompileUnit(language: DW_LANG_C_plus_plus_14, file: !1, producer: "clang version 11.0.0 (https://github.com/llvm/llvm-project.git 3156b1cf14de28ad1f53ce7d9600a779fc4f2866)", isOptimized: false, runtimeVersion: 0, emissionKind: FullDebug, enums: !2, nameTableKind: None)
+!1 = !DIFile(filename: "function-options.cpp", directory: "C:\\src\\tests\\duplicate-types\\llvm-test", checksumkind: CSK_MD5, checksum: "1f5fbce0c368787db7ca35021f86e1b4")
 !2 = !{}
 !3 = !{i32 2, !"CodeView", i32 1}
 !4 = !{i32 2, !"Debug Info Version", i32 3}
 !5 = !{i32 1, !"wchar_size", i32 2}
 !6 = !{i32 7, !"PIC Level", i32 2}
-!7 = !{!"clang version 8.0.0"}
-!8 = distinct !DISubprogram(name: "Func_AClass", linkageName: "?Func_AClass@@YA?AVAClass@@AEAV1@@Z", scope: !9, file: !9, line: 6, type: !10, isLocal: false, isDefinition: true, scopeLine: 6, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
-!9 = !DIFile(filename: "function-options.cpp", directory: "D:\5Cupstream\5Cllvm\5Ctest\5CDebugInfo\5CCOFF")
-!10 = !DISubroutineType(types: !11)
-!11 = !{!12, !13}
-!12 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "AClass", file: !9, line: 5, size: 8, flags: DIFlagTypePassByValue, elements: !2, identifier: ".?AVAClass@@")
-!13 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !12, size: 64)
-!14 = !DILocalVariable(name: "arg", arg: 1, scope: !8, file: !9, line: 6, type: !13)
-!15 = !DILocation(line: 6, scope: !8)
-!16 = distinct !DISubprogram(name: "Func_BClass", linkageName: "?Func_BClass@@YA?AVBClass@@AEAV1@@Z", scope: !9, file: !9, line: 12, type: !17, isLocal: false, isDefinition: true, scopeLine: 12, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
-!17 = !DISubroutineType(types: !18)
-!18 = !{!19, !25}
-!19 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "BClass", file: !9, line: 8, size: 8, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !20, identifier: ".?AVBClass@@")
-!20 = !{!21}
-!21 = !DISubprogram(name: "BClass", scope: !19, file: !9, line: 10, type: !22, isLocal: false, isDefinition: false, scopeLine: 10, flags: DIFlagExplicit | DIFlagPrototyped, isOptimized: false)
-!22 = !DISubroutineType(types: !23)
-!23 = !{null, !24}
-!24 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !19, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
-!25 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !19, size: 64)
-!26 = !DILocalVariable(name: "arg", arg: 1, scope: !16, file: !9, line: 12, type: !25)
-!27 = !DILocation(line: 12, scope: !16)
-!28 = distinct !DISubprogram(name: "Func_C1Class", linkageName: "?Func_C1Class@@YA?AVC1Class@@AEAV1@@Z", scope: !9, file: !9, line: 18, type: !29, isLocal: false, isDefinition: true, scopeLine: 18, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
-!29 = !DISubroutineType(types: !30)
-!30 = !{!31, !37}
-!31 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "C1Class", file: !9, line: 14, size: 8, flags: DIFlagTypePassByValue, elements: !32, identifier: ".?AVC1Class@@")
-!32 = !{!33}
-!33 = !DISubprogram(name: "C1Class", scope: !31, file: !9, line: 16, type: !34, isLocal: false, isDefinition: false, scopeLine: 16, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false)
-!34 = !DISubroutineType(types: !35)
-!35 = !{null, !36}
-!36 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !31, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
-!37 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !31, size: 64)
-!38 = !DILocalVariable(name: "arg", arg: 1, scope: !28, file: !9, line: 18, type: !37)
-!39 = !DILocation(line: 18, scope: !28)
-!40 = distinct !DISubprogram(name: "Func_C2Class", linkageName: "?Func_C2Class@@YA?AVC2Class@@AEAV1@@Z", scope: !9, file: !9, line: 24, type: !41, isLocal: false, isDefinition: true, scopeLine: 24, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
-!41 = !DISubroutineType(types: !42)
-!42 = !{!43, !49}
-!43 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "C2Class", file: !9, line: 20, size: 8, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !44, identifier: ".?AVC2Class@@")
-!44 = !{!45}
-!45 = !DISubprogram(name: "~C2Class", scope: !43, file: !9, line: 22, type: !46, isLocal: false, isDefinition: false, scopeLine: 22, flags: DIFlagPublic | DIFlagPrototyped, isOptimized: false)
-!46 = !DISubroutineType(types: !47)
-!47 = !{null, !48}
-!48 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !43, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
-!49 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !43, size: 64)
-!50 = !DILocalVariable(name: "arg", arg: 1, scope: !40, file: !9, line: 24, type: !49)
-!51 = !DILocation(line: 24, scope: !40)
-!52 = distinct !DISubprogram(name: "Func_DClass", linkageName: "?Func_DClass@@YA?AVDClass@@AEAV1@@Z", scope: !9, file: !9, line: 27, type: !53, isLocal: false, isDefinition: true, scopeLine: 27, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
-!53 = !DISubroutineType(types: !54)
-!54 = !{!55, !58}
-!55 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "DClass", file: !9, line: 26, size: 8, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !56, identifier: ".?AVDClass@@")
-!56 = !{!57}
-!57 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !55, baseType: !19, flags: DIFlagPublic, extraData: i32 0)
-!58 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !55, size: 64)
-!59 = !DILocalVariable(name: "arg", arg: 1, scope: !52, file: !9, line: 27, type: !58)
-!60 = !DILocation(line: 27, scope: !52)
-!61 = distinct !DISubprogram(name: "Func_FClass", linkageName: "?Func_FClass@@YA?AVFClass@@AEAV1@@Z", scope: !9, file: !9, line: 30, type: !62, isLocal: false, isDefinition: true, scopeLine: 30, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
-!62 = !DISubroutineType(types: !63)
-!63 = !{!64, !68}
-!64 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "FClass", file: !9, line: 29, size: 8, flags: DIFlagTypePassByValue, elements: !65, identifier: ".?AVFClass@@")
-!65 = !{!66}
-!66 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !64, file: !9, line: 29, baseType: !67, flags: DIFlagStaticMember)
-!67 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
-!68 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !64, size: 64)
-!69 = !DILocalVariable(name: "arg", arg: 1, scope: !61, file: !9, line: 30, type: !68)
-!70 = !DILocation(line: 30, scope: !61)
-!71 = distinct !DISubprogram(name: "Func_AStruct", linkageName: "?Func_AStruct@@YA?AUAStruct@@AEAU1@@Z", scope: !9, file: !9, line: 33, type: !72, isLocal: false, isDefinition: true, scopeLine: 33, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
-!72 = !DISubroutineType(types: !73)
-!73 = !{!74, !75}
-!74 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "AStruct", file: !9, line: 32, size: 8, flags: DIFlagTypePassByValue, elements: !2, identifier: ".?AUAStruct@@")
-!75 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !74, size: 64)
-!76 = !DILocalVariable(name: "arg", arg: 1, scope: !71, file: !9, line: 33, type: !75)
-!77 = !DILocation(line: 33, scope: !71)
-!78 = distinct !DISubprogram(name: "Func_BStruct", linkageName: "?Func_BStruct@@YA?AUBStruct@@AEAU1@@Z", scope: !9, file: !9, line: 36, type: !79, isLocal: false, isDefinition: true, scopeLine: 36, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
-!79 = !DISubroutineType(types: !80)
-!80 = !{!81, !87}
-!81 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "BStruct", file: !9, line: 35, size: 8, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !82, identifier: ".?AUBStruct@@")
-!82 = !{!83}
-!83 = !DISubprogram(name: "BStruct", scope: !81, file: !9, line: 35, type: !84, isLocal: false, isDefinition: false, scopeLine: 35, flags: DIFlagPrototyped, isOptimized: false)
-!84 = !DISubroutineType(types: !85)
-!85 = !{null, !86}
-!86 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !81, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
-!87 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !81, size: 64)
-!88 = !DILocalVariable(name: "arg", arg: 1, scope: !78, file: !9, line: 36, type: !87)
-!89 = !DILocation(line: 36, scope: !78)
-!90 = distinct !DISubprogram(name: "Func_AUnion", linkageName: "?Func_AUnion@@YA?ATAUnion@@AEAT1@@Z", scope: !9, file: !9, line: 39, type: !91, isLocal: false, isDefinition: true, scopeLine: 39, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
+!7 = !{!"clang version 11.0.0 (https://github.com/llvm/llvm-project.git 3156b1cf14de28ad1f53ce7d9600a779fc4f2866)"}
+!8 = distinct !DISubprogram(name: "Func_AClass", linkageName: "?Func_AClass@@YA?AVAClass@@AEAV1@@Z", scope: !1, file: !1, line: 5, type: !9, scopeLine: 5, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
+!9 = !DISubroutineType(types: !10)
+!10 = !{!11, !12}
+!11 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "AClass", file: !1, line: 4, size: 8, flags: DIFlagTypePassByValue, elements: !2, identifier: ".?AVAClass@@")
+!12 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !11, size: 64)
+!13 = !DILocalVariable(name: "arg", arg: 1, scope: !8, file: !1, line: 5, type: !12)
+!14 = !DILocation(line: 5, scope: !8)
+!15 = distinct !DISubprogram(name: "Func_BClass", linkageName: "?Func_BClass@@YA?AVBClass@@AEAV1@@Z", scope: !1, file: !1, line: 11, type: !16, scopeLine: 11, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
+!16 = !DISubroutineType(types: !17)
+!17 = !{!18, !24}
+!18 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "BClass", file: !1, line: 7, size: 8, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !19, identifier: ".?AVBClass@@")
+!19 = !{!20}
+!20 = !DISubprogram(name: "BClass", scope: !18, file: !1, line: 9, type: !21, scopeLine: 9, flags: DIFlagExplicit | DIFlagPrototyped, spFlags: 0)
+!21 = !DISubroutineType(types: !22)
+!22 = !{null, !23}
+!23 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !18, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!24 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !18, size: 64)
+!25 = !DILocalVariable(name: "arg", arg: 1, scope: !15, file: !1, line: 11, type: !24)
+!26 = !DILocation(line: 11, scope: !15)
+!27 = distinct !DISubprogram(name: "Func_C1Class", linkageName: "?Func_C1Class@@YA?AVC1Class@@AEAV1@@Z", scope: !1, file: !1, line: 17, type: !28, scopeLine: 17, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
+!28 = !DISubroutineType(types: !29)
+!29 = !{!30, !36}
+!30 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "C1Class", file: !1, line: 13, size: 8, flags: DIFlagTypePassByValue, elements: !31, identifier: ".?AVC1Class@@")
+!31 = !{!32}
+!32 = !DISubprogram(name: "C1Class", scope: !30, file: !1, line: 15, type: !33, scopeLine: 15, flags: DIFlagPublic | DIFlagPrototyped, spFlags: 0)
+!33 = !DISubroutineType(types: !34)
+!34 = !{null, !35}
+!35 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !30, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!36 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !30, size: 64)
+!37 = !DILocalVariable(name: "arg", arg: 1, scope: !27, file: !1, line: 17, type: !36)
+!38 = !DILocation(line: 17, scope: !27)
+!39 = distinct !DISubprogram(name: "Func_C2Class", linkageName: "?Func_C2Class@@YA?AVC2Class@@AEAV1@@Z", scope: !1, file: !1, line: 23, type: !40, scopeLine: 23, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
+!40 = !DISubroutineType(types: !41)
+!41 = !{!42, !48}
+!42 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "C2Class", file: !1, line: 19, size: 8, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !43, identifier: ".?AVC2Class@@")
+!43 = !{!44}
+!44 = !DISubprogram(name: "~C2Class", scope: !42, file: !1, line: 21, type: !45, scopeLine: 21, flags: DIFlagPublic | DIFlagPrototyped, spFlags: 0)
+!45 = !DISubroutineType(types: !46)
+!46 = !{null, !47}
+!47 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !42, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!48 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !42, size: 64)
+!49 = !DILocalVariable(name: "arg", arg: 1, scope: !39, file: !1, line: 23, type: !48)
+!50 = !DILocation(line: 23, scope: !39)
+!51 = distinct !DISubprogram(name: "Func_DClass", linkageName: "?Func_DClass@@YA?AVDClass@@AEAV1@@Z", scope: !1, file: !1, line: 26, type: !52, scopeLine: 26, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
+!52 = !DISubroutineType(types: !53)
+!53 = !{!54, !57}
+!54 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "DClass", file: !1, line: 25, size: 8, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !55, identifier: ".?AVDClass@@")
+!55 = !{!56}
+!56 = !DIDerivedType(tag: DW_TAG_inheritance, scope: !54, baseType: !18, flags: DIFlagPublic, extraData: i32 0)
+!57 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !54, size: 64)
+!58 = !DILocalVariable(name: "arg", arg: 1, scope: !51, file: !1, line: 26, type: !57)
+!59 = !DILocation(line: 26, scope: !51)
+!60 = distinct !DISubprogram(name: "Func_FClass", linkageName: "?Func_FClass@@YA?AVFClass@@AEAV1@@Z", scope: !1, file: !1, line: 29, type: !61, scopeLine: 29, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
+!61 = !DISubroutineType(types: !62)
+!62 = !{!63, !67}
+!63 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "FClass", file: !1, line: 28, size: 8, flags: DIFlagTypePassByValue, elements: !64, identifier: ".?AVFClass@@")
+!64 = !{!65}
+!65 = !DIDerivedType(tag: DW_TAG_member, name: "x", scope: !63, file: !1, line: 28, baseType: !66, flags: DIFlagStaticMember)
+!66 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+!67 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !63, size: 64)
+!68 = !DILocalVariable(name: "arg", arg: 1, scope: !60, file: !1, line: 29, type: !67)
+!69 = !DILocation(line: 29, scope: !60)
+!70 = distinct !DISubprogram(name: "Func_HClass", linkageName: "?Func_HClass@@YA?AVHClass@@AEAV1@@Z", scope: !1, file: !1, line: 37, type: !71, scopeLine: 37, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
+!71 = !DISubroutineType(types: !72)
+!72 = !{!73, !87}
+!73 = distinct !DICompositeType(tag: DW_TAG_class_type, name: "HClass", file: !1, line: 32, size: 8, flags: DIFlagTypePassByValue, elements: !74, identifier: ".?AVHClass@@")
+!74 = !{!75, !79, !82}
+!75 = !DISubprogram(name: "Member_AClass", linkageName: "?Member_AClass@HClass@@AEAA?AVAClass@@AEAV2@@Z", scope: !73, file: !1, line: 33, type: !76, scopeLine: 33, flags: DIFlagPrototyped, spFlags: 0)
+!76 = !DISubroutineType(types: !77)
+!77 = !{!11, !78, !12}
+!78 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !73, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!79 = !DISubprogram(name: "Member_BClass", linkageName: "?Member_BClass@HClass@@AEAA?AVBClass@@AEAV2@@Z", scope: !73, file: !1, line: 34, type: !80, scopeLine: 34, flags: DIFlagPrototyped, spFlags: 0)
+!80 = !DISubroutineType(types: !81)
+!81 = !{!18, !78, !24}
+!82 = !DISubprogram(name: "Member_GClass", linkageName: "?Member_GClass@HClass@@AEAA?AVGClass@@AEAV2@@Z", scope: !73, file: !1, line: 35, type: !83, scopeLine: 35, flags: DIFlagPrototyped, spFlags: 0)
+!83 = !DISubroutineType(types: !84)
+!84 = !{!85, !78, !86}
+!85 = !DICompositeType(tag: DW_TAG_class_type, name: "GClass", file: !1, line: 31, flags: DIFlagFwdDecl, identifier: ".?AVGClass@@")
+!86 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !85, size: 64)
+!87 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !73, size: 64)
+!88 = !DILocalVariable(name: "arg", arg: 1, scope: !70, file: !1, line: 37, type: !87)
+!89 = !DILocation(line: 37, scope: !70)
+!90 = distinct !DISubprogram(name: "Func_AStruct", linkageName: "?Func_AStruct@@YA?AUAStruct@@AEAU1@@Z", scope: !1, file: !1, line: 40, type: !91, scopeLine: 40, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
 !91 = !DISubroutineType(types: !92)
 !92 = !{!93, !94}
-!93 = distinct !DICompositeType(tag: DW_TAG_union_type, name: "AUnion", file: !9, line: 38, size: 8, flags: DIFlagTypePassByValue, elements: !2, identifier: ".?ATAUnion@@")
+!93 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "AStruct", file: !1, line: 39, size: 8, flags: DIFlagTypePassByValue, elements: !2, identifier: ".?AUAStruct@@")
 !94 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !93, size: 64)
-!95 = !DILocalVariable(name: "arg", arg: 1, scope: !90, file: !9, line: 39, type: !94)
-!96 = !DILocation(line: 39, scope: !90)
-!97 = distinct !DISubprogram(name: "Func_BUnion", linkageName: "?Func_BUnion@@YA?ATBUnion@@AEAT1@@Z", scope: !9, file: !9, line: 42, type: !98, isLocal: false, isDefinition: true, scopeLine: 42, flags: DIFlagPrototyped, isOptimized: false, unit: !0, retainedNodes: !2)
+!95 = !DILocalVariable(name: "arg", arg: 1, scope: !90, file: !1, line: 40, type: !94)
+!96 = !DILocation(line: 40, scope: !90)
+!97 = distinct !DISubprogram(name: "Func_BStruct", linkageName: "?Func_BStruct@@YA?AUBStruct@@AEAU1@@Z", scope: !1, file: !1, line: 43, type: !98, scopeLine: 43, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
 !98 = !DISubroutineType(types: !99)
 !99 = !{!100, !106}
-!100 = distinct !DICompositeType(tag: DW_TAG_union_type, name: "BUnion", file: !9, line: 41, size: 8, flags: DIFlagTypePassByValue, elements: !101, identifier: ".?ATBUnion@@")
+!100 = distinct !DICompositeType(tag: DW_TAG_structure_type, name: "BStruct", file: !1, line: 42, size: 8, flags: DIFlagTypePassByValue | DIFlagNonTrivial, elements: !101, identifier: ".?AUBStruct@@")
 !101 = !{!102}
-!102 = !DISubprogram(name: "BUnion", scope: !100, file: !9, line: 41, type: !103, isLocal: false, isDefinition: false, scopeLine: 41, flags: DIFlagPrototyped, isOptimized: false)
+!102 = !DISubprogram(name: "BStruct", scope: !100, file: !1, line: 42, type: !103, scopeLine: 42, flags: DIFlagPrototyped, spFlags: 0)
 !103 = !DISubroutineType(types: !104)
 !104 = !{null, !105}
 !105 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !100, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
 !106 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !100, size: 64)
-!107 = !DILocalVariable(name: "arg", arg: 1, scope: !97, file: !9, line: 42, type: !106)
-!108 = !DILocation(line: 42, scope: !97)
+!107 = !DILocalVariable(name: "arg", arg: 1, scope: !97, file: !1, line: 43, type: !106)
+!108 = !DILocation(line: 43, scope: !97)
+!109 = distinct !DISubprogram(name: "Func_AUnion", linkageName: "?Func_AUnion@@YA?ATAUnion@@AEAT1@@Z", scope: !1, file: !1, line: 46, type: !110, scopeLine: 46, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
+!110 = !DISubroutineType(types: !111)
+!111 = !{!112, !113}
+!112 = distinct !DICompositeType(tag: DW_TAG_union_type, name: "AUnion", file: !1, line: 45, size: 8, flags: DIFlagTypePassByValue, elements: !2, identifier: ".?ATAUnion@@")
+!113 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !112, size: 64)
+!114 = !DILocalVariable(name: "arg", arg: 1, scope: !109, file: !1, line: 46, type: !113)
+!115 = !DILocation(line: 46, scope: !109)
+!116 = distinct !DISubprogram(name: "Func_BUnion", linkageName: "?Func_BUnion@@YA?ATBUnion@@AEAT1@@Z", scope: !1, file: !1, line: 49, type: !117, scopeLine: 49, flags: DIFlagPrototyped, spFlags: DISPFlagDefinition, unit: !0, retainedNodes: !2)
+!117 = !DISubroutineType(types: !118)
+!118 = !{!119, !125}
+!119 = distinct !DICompositeType(tag: DW_TAG_union_type, name: "BUnion", file: !1, line: 48, size: 8, flags: DIFlagTypePassByValue, elements: !120, identifier: ".?ATBUnion@@")
+!120 = !{!121}
+!121 = !DISubprogram(name: "BUnion", scope: !119, file: !1, line: 48, type: !122, scopeLine: 48, flags: DIFlagPrototyped, spFlags: 0)
+!122 = !DISubroutineType(types: !123)
+!123 = !{null, !124}
+!124 = !DIDerivedType(tag: DW_TAG_pointer_type, baseType: !119, size: 64, flags: DIFlagArtificial | DIFlagObjectPointer)
+!125 = !DIDerivedType(tag: DW_TAG_reference_type, baseType: !119, size: 64)
+!126 = !DILocalVariable(name: "arg", arg: 1, scope: !116, file: !1, line: 49, type: !125)
+!127 = !DILocation(line: 49, scope: !116)
Index: llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
===================================================================
--- llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
+++ llvm/lib/CodeGen/AsmPrinter/CodeViewDebug.cpp
@@ -418,8 +418,10 @@
       ReturnTy = TypeArray[0];
   }
 
+  // Add CxxReturnUdt option to functions that return nontrivial record types
+  // or methods that return record types.
   if (auto *ReturnDCTy = dyn_cast_or_null<DICompositeType>(ReturnTy)) {
-    if (isNonTrivial(ReturnDCTy))
+    if (isNonTrivial(ReturnDCTy) || ClassTy)
       FO |= FunctionOptions::CxxReturnUdt;
   }
 
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to