[PATCH] D80369: [DebugInfo][CallSites] Remove decl subprograms from 'retainedTypes:'

David Blaikie via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Tue May 26 19:38:10 PDT 2020


dblaikie added a comment.

In D80369#2056094 <https://reviews.llvm.org/D80369#2056094>, @aprantl wrote:

> > How does this data get used for Swift code and ObjC interoperability? At the moment I see no use of this IR metadata in LLVM. Does ObjC/Swift interop use the DI IR over in the Swift compiler? Got a link to the code there?
>
> Are you saying the retained types are not emitted in DWARF?


Sort of. I'm saying /these/ types (the ones that these tests are testing for) aren't retained types. The declaration subprograms are in the retained types list - but when retained types are emitted, only types in the retained types list are used, the subprograms (and the types they only indirectly reference) are ignored.

Ah, nope, I'm wrong - I /thought/ the test was correctly flagging these types as missing - that the only reason the types were there was because their subprogram was in the retained types list.

That's incorrect - the types are here, they're just reordered because. At least for the C++ test, this change makes it pass:

  diff --git clang/test/Modules/ModuleDebugInfo.cpp clang/test/Modules/ModuleDebugInfo.cpp
  index 26369c89605..b1ffe27ec22 100644
  --- clang/test/Modules/ModuleDebugInfo.cpp
  +++ clang/test/Modules/ModuleDebugInfo.cpp
  @@ -51,15 +51,6 @@
   // CHECK-SAME:             )
   // CHECK: !DIEnumerator(name: "e5", value: 5, isUnsigned: true)
   
  -// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "B",
  -// no mangled name here yet.
  -
  -// This type is anchored by a function parameter.
  -// CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "A<void>"
  -// CHECK-SAME:             elements:
  -// CHECK-SAME:             templateParams:
  -// CHECK-SAME:             identifier: "_ZTSN8DebugCXX1AIJvEEE")
  -
   // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Struct"
   // CHECK-SAME:             identifier: "_ZTSN8DebugCXX6StructE")
   
  @@ -85,6 +76,12 @@
   // CHECK-SAME:             templateParams:
   // CHECK-SAME:             identifier: "_ZTSN8DebugCXX8TemplateIlNS_6traitsIlEEEE")
   
  +// This type is anchored by a function parameter.
  +// CHECK: !DICompositeType(tag: DW_TAG_class_type, name: "A<void>"
  +// CHECK-SAME:             elements:
  +// CHECK-SAME:             templateParams:
  +// CHECK-SAME:             identifier: "_ZTSN8DebugCXX1AIJvEEE")
  +
   // CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "FloatInstantiation"
   // no mangled name here yet.
   
  @@ -93,6 +90,9 @@
   // CHECK-SAME:             flags: DIFlagFwdDecl
   // CHECK-SAME:             identifier: "_ZTSN8DebugCXX8TemplateIfNS_6traitsIfEEEE")
   
  +// CHECK: !DIDerivedType(tag: DW_TAG_typedef, name: "B",
  +// no mangled name here yet.
  +
   // CHECK: !DICompositeType(tag: DW_TAG_structure_type, name: "Virtual"
   // CHECK-SAME:             elements:
   // CHECK-SAME:             identifier: "_ZTS7Virtual")




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

https://reviews.llvm.org/D80369





More information about the cfe-commits mailing list