[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:54:25 PDT 2024


================
@@ -2755,7 +2755,7 @@ CGDebugInfo::CreateTypeDefinition(const RecordType *Ty) {
 
   // Collect data fields (including static variables and any initializers).
   CollectRecordFields(RD, DefUnit, EltTys, FwdDecl);
-  if (CXXDecl)
+  if (CXXDecl && !CGM.getCodeGenOpts().DebugOmitUnreferencedMembers)
----------------
dwblaikie wrote:

Added that at the driver level - and similarly for type units (since they use an mllvm flag, clang frontend/codegen doesn't actually know if type units are enabled). (though this doesn't work out /that/ badly for type units, in some sense - the type units are still consistent, they just consistently contain no member functions (in the same way that even without the flag, for things like member function template instantiations we never put them in the member list, so they never end up in type units - only attached as declarations to the skeleton type DIE in the CU))

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


More information about the cfe-commits mailing list