[PATCH] D80242: [Clang] implement -fno-eliminate-unused-debug-types

Nick Desaulniers via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 19 11:26:59 PDT 2020


nickdesaulniers added inline comments.


================
Comment at: clang/lib/CodeGen/CGDecl.cpp:103-118
+  case Decl::CXXRecord: // struct/union/class X; [C++]
+    if (CGDebugInfo *DI = getDebugInfo())
+      if (CGM.getCodeGenOpts().hasMaybeUnusedDebugInfo() &&
+          cast<CXXRecordDecl>(D).hasDefinition())
+        DI->completeUnusedClass(cast<CXXRecordDecl>(D));
+    return;
   case Decl::Record:    // struct/union/class X;
----------------
nickdesaulniers wrote:
> dblaikie wrote:
> > All of these might be able to be collapsed together - using "cast<TagDecl>(D).hasDefinition()" ... to have a common implementation.
> `TagDecl` doesn't have a method `hasDefinition`.  Only `CXXRecordDecl` does.
Also, how to get the `QualType` differs between `Decl::Enum` an `Decl::Record`; `getEnumType` vs `getRecordType` respectively.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D80242





More information about the cfe-commits mailing list