[PATCH] D66352: Debug Info: Support for DW_AT_export_symbols for anonymous structs

Adrian Prantl via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Aug 16 08:18:04 PDT 2019


aprantl added inline comments.


================
Comment at: include/llvm/IR/DebugInfoFlags.def:45
 HANDLE_DI_FLAG((1 << 14), RValueReference)
-// 15 was formerly ExternalTypeRef, but this was never used.
-HANDLE_DI_FLAG((1 << 15), Reserved)
+HANDLE_DI_FLAG((1 << 15), ExportSymbols)
 HANDLE_DI_FLAG((1 << 16), SingleInheritance)
----------------
The re-use of bit 16 is okay, as the comment says, this Apple-specific flag is not in use and there are not bitcode compatibility concerns.


================
Comment at: include/llvm/IR/DebugInfoMetadata.h:671
   bool isLittleEndian() const { return getFlags() & FlagLittleEndian; }
+  bool isExportSymbols() const { return getFlags() & FlagExportSymbols; }
 
----------------
Like in DINamespace, this should be called getExportSymbols() (or rename both).


================
Comment at: test/Assembler/export-symbol-anonymous-class.ll:31
+!8 = !DIDerivedType(tag: DW_TAG_member, scope: !6, file: !3, line: 2, baseType: !9, size: 32)
+!9 = distinct !DICompositeType(tag: DW_TAG_structure_type, scope: !6, file: !3, line: 2, size: 32, flags: DIFlagExportSymbols | DIFlagTypePassByValue, elements: !10, identifier: "_ZTSN1AUt_E")
+; CHECK: DIFlagExportSymbols | DIFlagTypePassByValue
----------------
My guess is that you can reduce the entire test to 

!named = !{!9}
!9 = distinct !DICompositeType(tag: DW_TAG_structure_type, scope: !6, file: !3, line: 2, size: 32, flags: DIFlagExportSymbols | DIFlagTypePassByValue, elements: !10, identifier: "_ZTSN1AUt_E")

otoh, showing the flag in its natural context is also useful, so let's keep it this way.


================
Comment at: test/Assembler/export-symbol-anonymous-class.ll:36
+!12 = !DIBasicType(name: "int", size: 32, encoding: DW_ATE_signed)
+!13 = !{i32 2, !"SDK Version", [2 x i32] [i32 10, i32 14]}
+!14 = !{i32 2, !"Dwarf Version", i32 4}
----------------
We can delete this, it distracts


================
Comment at: test/Assembler/export-symbol-anonymous-class.ll:39
+!15 = !{i32 2, !"Debug Info Version", i32 3}
+!16 = !{i32 1, !"wchar_size", i32 4}
+!17 = !{i32 7, !"PIC Level", i32 2}
----------------
this,


================
Comment at: test/Assembler/export-symbol-anonymous-class.ll:40
+!16 = !{i32 1, !"wchar_size", i32 4}
+!17 = !{i32 7, !"PIC Level", i32 2}
+!18 = !{!"clang version 10.0.0 (https://git.llvm.org/git/clang.git/ a16001b1bd2c421174838df17f629807c62e7d1b) (https://git.llvm.org/git/llvm.git/ dbc62cefba151b78de3779348509c27581c58d72)"}
----------------
and this


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

https://reviews.llvm.org/D66352





More information about the llvm-commits mailing list