[clang] [DebugInfo] Add flag to only emit referenced member functions (PR #87018)

David Blaikie via cfe-commits cfe-commits at lists.llvm.org
Fri May 24 14:56:08 PDT 2024


================
@@ -4260,6 +4260,13 @@ defm strict_dwarf : BoolOption<"g", "strict-dwarf",
           "the specified version, avoiding features from later versions.">,
   NegFlag<SetFalse>, BothFlags<[], [ClangOption, CLOption, DXCOption]>>,
   Group<g_flags_Group>;
+defm omit_unreferenced_members : BoolOption<"g", "omit-unreferenced-members",
+  CodeGenOpts<"DebugOmitUnreferencedMembers">, DefaultFalse,
+  PosFlag<SetTrue, [], [ClangOption, CC1Option],
+  	"Omit member function declarations from type descriptions if the "
+	"member is unreferenced.">,
+  NegFlag<SetFalse>, BothFlags<[], [ClangOption, CLOption, DXCOption]>>,
+  Group<g_flags_Group>;
----------------
dwblaikie wrote:

Wasn't able to get this to avoid the `renderDebugOptions` code - even other uses of marshalling (and it looks like BoolOption, and even BoolGOption, have some marshalling details in their implementation - so maybe they're getting the same functionality as MarshallingInfoFlag already?) seem to still have to handle/repeat the flag from the driver to the frontend.

Oh, and now that I'm checking compatible flags in the driver (disabling this feature if -fstandalone-debug or -fdebug-types-section are enabled) then there's probably no avoiding having some code there anyway.

Switching to BoolGOption does make it a bit tidier, though.

https://github.com/llvm/llvm-project/pull/87018


More information about the cfe-commits mailing list