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

2020-08-10 Thread Nick Desaulniers via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. nickdesaulniers marked an inline comment as done. Closed by commit rG4f2ad15db535: [Clang] implement -fno-eliminate-unused-debug-types (authored by nickdesaulniers). Repository: rG LLVM Github Monorepo CHANGES SINCE

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

2020-08-10 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers marked 2 inline comments as done. nickdesaulniers added inline comments. Comment at: clang/test/Driver/debug-options.c:371-373 +// RUN: %clang -### -fno-eliminate-unused-debug-types -g1 -c %s 2>&1 \ +// RUN:| FileCheck -check-prefix=NO_DEBUG_UNUSED_TYPES

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

2020-08-10 Thread David Blaikie via Phabricator via cfe-commits
dblaikie accepted this revision. dblaikie added a comment. Looks good, thanks! Comment at: clang/test/Driver/debug-options.c:371-373 +// RUN: %clang -### -fno-eliminate-unused-debug-types -g1 -c %s 2>&1 \ +// RUN:| FileCheck -check-prefix=NO_DEBUG_UNUSED_TYPES %s +//

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

2020-08-10 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added inline comments. Comment at: clang/test/Driver/debug-options.c:371-373 +// RUN: %clang -### -fno-eliminate-unused-debug-types -g1 -c %s 2>&1 \ +// RUN:| FileCheck -check-prefix=NO_DEBUG_UNUSED_TYPES %s +// NO_DEBUG_UNUSED_TYPES:

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

2020-08-10 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added inline comments. Comment at: clang/test/Driver/debug-options.c:371-373 +// RUN: %clang -### -fno-eliminate-unused-debug-types -g1 -c %s 2>&1 \ +// RUN:| FileCheck -check-prefix=NO_DEBUG_UNUSED_TYPES %s +// NO_DEBUG_UNUSED_TYPES:

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

2020-08-10 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. Hi @dblaikie , sorry for messing up the upload, I think it's good now, but to see the latest change, you'll need to look at the diff between the 2 prior versions (https://reviews.llvm.org/D80242?vs=284053=284477#toc). I reverted this on Friday. It looks like

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

2020-08-10 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 284477. nickdesaulniers added a comment. - squash and reupload Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/ https://reviews.llvm.org/D80242 Files:

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

2020-08-10 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 284476. nickdesaulniers added a comment. This revision is now accepted and ready to land. - rebase, move Codegen tests to _cc1, move -g1 test to driver test, use more regex for ![0-9]+, manually test --target=x86_64-apple-macosx10.15.0 which has a

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

2020-08-07 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. So it looks like `%clang++` should be `%clangxx` for windows, then for OSX the default value of `debug-info-kind` is different, while the tests also seem to fail there. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2020-08-07 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. Looks like another related failure for http://green.lab.llvm.org/green/job/clang-stage1-RA/13460/consoleFull#-42777206a1ca8a51-895e-46c6-af87-ce24fa4cd561 ? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/

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

2020-08-07 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. fix pushed in cbd8ec93709376fbf404c99f4eee399790e26db7 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/ https://reviews.llvm.org/D80242

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

2020-08-07 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. build failure on windows: http://lab.llvm.org:8011/builders/llvm-clang-win-x-aarch64/builds/1886/steps/test-check-clang/logs/FAIL%3A%20Clang%3A%3Adebug-info-unused-types.cpp Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2020-08-07 Thread Nick Desaulniers via Phabricator via cfe-commits
This revision was landed with ongoing or failed builds. This revision was automatically updated to reflect the committed changes. Closed by commit rGe486921fd6cf: [Clang] implement -fno-eliminate-unused-debug-types (authored by nickdesaulniers). Repository: rG LLVM Github Monorepo CHANGES

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

2020-08-07 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 284048. nickdesaulniers added a comment. - git clang-format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/ https://reviews.llvm.org/D80242 Files: clang/docs/ClangCommandLineReference.rst

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

2020-08-07 Thread David Blaikie via Phabricator via cfe-commits
dblaikie accepted this revision. dblaikie added a comment. This revision is now accepted and ready to land. Looks good - thanks! Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/ https://reviews.llvm.org/D80242

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

2020-08-07 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 284011. nickdesaulniers added a comment. - rebase, centralize DebugInfoKind update as per @dblaikie Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/ https://reviews.llvm.org/D80242 Files:

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

2020-08-07 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added inline comments. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:3787-3788 (void)checkDebugInfoOption(A, Args, D, TC); if (DebugInfoKind == codegenoptions::LimitedDebugInfo && NeedFullDebug) DebugInfoKind = codegenoptions::FullDebugInfo;

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

2020-08-07 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. bumping for review Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/ https://reviews.llvm.org/D80242 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2020-07-31 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers marked an inline comment as not done. nickdesaulniers added inline comments. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:3842-3846 + if (EmitDwarf && + Args.hasFlag(options::OPT_fno_eliminate_unused_debug_types, +

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

2020-07-31 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 282307. nickdesaulniers marked 4 inline comments as done. nickdesaulniers added a comment. - rebase, add captures to tests, simplify NODBG-NOT cases Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2020-07-21 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added inline comments. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:3842-3846 + if (EmitDwarf && + Args.hasFlag(options::OPT_fno_eliminate_unused_debug_types, + options::OPT_feliminate_unused_debug_types, false) && + DebugInfoKind >=

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

2020-07-21 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added inline comments. Comment at: clang/lib/Driver/ToolChains/Clang.cpp:3825-3828 + if (EmitDwarf && + Args.hasFlag(options::OPT_fno_eliminate_unused_debug_types, + options::OPT_feliminate_unused_debug_types, false)) +DebugInfoKind =

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

2020-07-21 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 279643. nickdesaulniers marked 4 inline comments as done. nickdesaulniers added a comment. - rebase, add -g1 test case, don't emit unless -g2 or higher Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2020-07-17 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:5385 + if (getCodeGenOpts().hasMaybeUnusedDebugInfo() && CRD->hasDefinition()) +DI->completeUnusedClass(*CRD); + else if (auto *ES = D->getASTContext().getExternalSource())

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

2020-07-16 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:5385 + if (getCodeGenOpts().hasMaybeUnusedDebugInfo() && CRD->hasDefinition()) +DI->completeUnusedClass(*CRD); + else if (auto *ES = D->getASTContext().getExternalSource())

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

2020-07-16 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 278557. nickdesaulniers marked 9 inline comments as done. nickdesaulniers added a comment. Herald added a subscriber: dang. - rebase on 227db86a1b7dd , update NOT checks

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

2020-07-06 Thread David Blaikie via Phabricator via cfe-commits
dblaikie 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(D).hasDefinition()) +

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

2020-07-06 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. Bumping for review Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/ https://reviews.llvm.org/D80242 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2020-06-30 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 274636. nickdesaulniers added a comment. - fix documentation double negation Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/ https://reviews.llvm.org/D80242 Files:

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

2020-06-30 Thread Paul Robinson via Phabricator via cfe-commits
probinson added inline comments. Comment at: clang/docs/ClangCommandLineReference.rst:2155 + +Emit debug info for types that are unused but defined by the program. + I think this description goes counter to how other options are described, which basically is

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

2020-06-30 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. bumping for review Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/ https://reviews.llvm.org/D80242 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2020-06-24 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. Bumping for review. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/ https://reviews.llvm.org/D80242 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2020-06-22 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 272546. nickdesaulniers added a comment. - fix clang/test/OpenMP/parallel_codegen.cpp Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/ https://reviews.llvm.org/D80242 Files:

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

2020-06-19 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 272143. nickdesaulniers marked an inline comment as done. nickdesaulniers added a comment. - make cases more uniform, cleanup some missed fixes Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/

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

2020-06-19 Thread Nick Desaulniers via Phabricator via cfe-commits
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() && +

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

2020-06-19 Thread Nick Desaulniers via Phabricator via cfe-commits
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() && +

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

2020-06-18 Thread David Blaikie via Phabricator via cfe-commits
dblaikie 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(D).hasDefinition()) +

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

2020-06-18 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 271887. nickdesaulniers added a comment. - git clang-format HEAD~ Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/ https://reviews.llvm.org/D80242 Files:

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

2020-06-18 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 271884. nickdesaulniers added a comment. - rebase - make feature progression of debug-info-kind - fix docs (define, not declare) - add driver tests - use OptOutFFlag tablegen helper - rename helper to EmitAndRetainType - dont emit debug info for

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

2020-06-18 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. Ok, I think I have all feedback addresses locally. One issue I'm hitting is that I'm regressing clang/test/OpenMP/parallel_codegen.cpp. Specifically, it seems it has code like: template

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

2020-06-17 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. In D80242#2093785 , @dblaikie wrote: > > - fix docs (use declare consistently, avoid define) > > Defined would be the right word here (declaring a type is code like "struct > foo;" - and this change probably

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

2020-06-15 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added a comment. > - fix docs (use declare consistently, avoid define) Defined would be the right word here (declaring a type is code like "struct foo;" - and this change probably doesn't/shouldn't emit debug info for type declarations, yes?) Comment at:

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

2020-06-10 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 269981. nickdesaulniers added a comment. - update comment to CODEGENOPT - avoid BooleanFFlag group Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/ https://reviews.llvm.org/D80242 Files:

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

2020-06-10 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 269977. nickdesaulniers added a comment. - rebase - fix docs (use declare consistently, avoid define) - add driver test - fix command line check Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/

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

2020-06-10 Thread Paul Robinson via Phabricator via cfe-commits
probinson added a subscriber: debug-info. probinson added a comment. +debug-info tag Needs a Driver test to show that the Right Thing gets passed to cc1. Comment at: clang/docs/CommandGuide/clang.rst:438 + + By default, Clang does not emit type information for types that are

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

2020-06-09 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. Bumping for review. Are there additional reviewers we can entrust code review to, to help share the code review responsibility? Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/

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

2020-06-02 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 268002. nickdesaulniers added a comment. - handle non top level decls, add tests Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/ https://reviews.llvm.org/D80242 Files:

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

2020-06-02 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers planned changes to this revision. nickdesaulniers added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:5317 /// EmitTopLevelDecl - Emit code for a single top level declaration. void CodeGenModule::EmitTopLevelDecl(Decl *D) { // Ignore

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

2020-06-02 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 267970. nickdesaulniers added a comment. - add documentation Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/ https://reviews.llvm.org/D80242 Files: clang/docs/ClangCommandLineReference.rst

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

2020-06-02 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added inline comments. Comment at: clang/lib/Frontend/CompilerInvocation.cpp:768 Opts.DebugFwdTemplateParams = Args.hasArg(OPT_debug_forward_template_params); + Opts.DebugUnusedTypes = Args.hasArg(OPT_eliminate_unused_debug_types_fno); Opts.EmbedSource =

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

2020-06-01 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 267756. nickdesaulniers added a comment. - missed one part of the rebase Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/ https://reviews.llvm.org/D80242 Files:

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

2020-06-01 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 267751. nickdesaulniers added a comment. - rebase on 1b6d29e06b07e518025b6f06445ad3275d6f5684 and D80840 (no other changes yet) Repository:

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

2020-06-01 Thread Paul Robinson via Phabricator via cfe-commits
probinson added a comment. In D80242#2045362 , @nickdesaulniers wrote: > For C++, I'd imagine: > > class foo {}; > using my_foo = foo; > template > struct baz { > bar my_bar; > }; > > > but it seems that `g++` doesn't emit debug info the

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

2020-05-30 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added inline comments. Comment at: clang/include/clang/Basic/CodeGenOptions.def:291 ///< including them in the name). +CODEGENOPT(DebugUnusedTypes, 1, 0) /// < Whether to emit typedefs that may be +

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

2020-05-30 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:5565 +if (CGDebugInfo *DI = getModuleDebugInfo()) + if (getCodeGenOpts().DebugUnusedTypes) { +QualType QT = getContext().getTypedefType(cast(D)); nickdesaulniers

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

2020-05-29 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:5559 + case Decl::Typedef: +if (getCodeGenOpts().DebugUnusedTypes) + if (CGDebugInfo *DI = getModuleDebugInfo()) nickdesaulniers wrote: > dblaikie wrote: > > Probably test

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

2020-05-29 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers marked an inline comment as done. nickdesaulniers added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:5565 +if (CGDebugInfo *DI = getModuleDebugInfo()) + if (getCodeGenOpts().DebugUnusedTypes) { +QualType QT =

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

2020-05-29 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers marked 3 inline comments as done. nickdesaulniers added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:5369 if (ES->hasExternalDefinitions(D) == ExternalASTSource::EK_Never) - DebugInfo->completeUnusedClass(cast(*D)); +

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

2020-05-29 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added inline comments. Comment at: clang/lib/Frontend/CompilerInvocation.cpp:768 Opts.DebugFwdTemplateParams = Args.hasArg(OPT_debug_forward_template_params); + Opts.DebugUnusedTypes = Args.hasArg(OPT_eliminate_unused_debug_types_fno); Opts.EmbedSource =

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

2020-05-28 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:5369 if (ES->hasExternalDefinitions(D) == ExternalASTSource::EK_Never) - DebugInfo->completeUnusedClass(cast(*D)); + DebugInfo->completeUnusedClass(*CRD); }

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

2020-05-27 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. Bumping for review Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/ https://reviews.llvm.org/D80242 ___ cfe-commits mailing list cfe-commits@lists.llvm.org

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

2020-05-20 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 265306. nickdesaulniers added a comment. - add enum class test case Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/ https://reviews.llvm.org/D80242 Files:

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

2020-05-20 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. probably should add a test for `enum class` in C++ Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/ https://reviews.llvm.org/D80242 ___ cfe-commits mailing

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

2020-05-20 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:5559 + case Decl::Typedef: +if (getCodeGenOpts().DebugUnusedTypes) + if (CGDebugInfo *DI = getModuleDebugInfo()) dblaikie wrote: > Probably test this within the

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

2020-05-19 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added inline comments. Comment at: clang/lib/CodeGen/CodeGenModule.cpp:5369 if (ES->hasExternalDefinitions(D) == ExternalASTSource::EK_Never) - DebugInfo->completeUnusedClass(cast(*D)); + DebugInfo->completeUnusedClass(*CRD); }

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

2020-05-19 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 265093. nickdesaulniers added a comment. - add C++ `using` and `class` support Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/ https://reviews.llvm.org/D80242 Files:

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

2020-05-19 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. `CXXRecordDecl` is a funny case, the AST looks like: |-CXXRecordDecl 0x5c661a8 col:7 class foo definition | |-DefinitionData pass_in_registers empty aggregate standard_layout trivially_copyable pod trivial literal has_constexpr_non_copy_ |

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

2020-05-19 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers updated this revision to Diff 265077. nickdesaulniers added a comment. - add support for structs, unions, and enums Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/ https://reviews.llvm.org/D80242 Files:

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

2020-05-19 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. For C++, I'd imagine: class foo {}; using my_foo = foo; template struct baz { bar my_bar; }; but it seems that `g++` doesn't emit debug info the for the templated struct. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2020-05-19 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added inline comments. Comment at: clang/lib/CodeGen/CGDebugInfo.cpp:4965 + DBuilder.retainType(Ty); +} Looks like I can just reuse CGDebugInfo::EmitExplicitCastType Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION

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

2020-05-19 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers added a comment. ah, right. I need to additionally handle structs, unions, enums. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D80242/new/ https://reviews.llvm.org/D80242 ___

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

2020-05-19 Thread David Blaikie via Phabricator via cfe-commits
dblaikie added a comment. Looks like this only implements support for typedefs, but the flag in GCC does more than that (as the flag name indicates - it's about unused types in general) - could you test this across some non-trivial code and see if it matches GCC's behavior (or, where it

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

2020-05-19 Thread Nick Desaulniers via Phabricator via cfe-commits
nickdesaulniers created this revision. nickdesaulniers added reviewers: echristo, dblaikie. Herald added a project: clang. Herald added a subscriber: cfe-commits. Fixes pr/11710. Signed-off-by: Nick Desaulniers Repository: rG LLVM Github Monorepo https://reviews.llvm.org/D80242 Files: