This is an archive of the discontinued LLVM Phabricator instance.

Handle more declarations in DeclContextPrinter to fix -print-decl-contexts crashes
ClosedPublic

Authored by arphaman on Nov 22 2016, 4:17 AM.

Details

Summary

This patch handles more declarations in DeclContextPrinter to avoid crashes when clang is given the -print-decl-contexts option. I would like to get an opinion on the testing in this patch - the current -print-decl-contexts test doesn't check the output, so this patch follows the same testing protocol. Do you think I should also check the output of -print-decl-contexts?

This patch contains 7 commits that I squashed just for review to make it easier:

  • DeclContextPrinter: Handle StaticAssertDecl
  • DeclContextPrinter: Handle variable template declaration
  • DeclContextPrinter: Handle Access specifier declaration
  • DeclContextPrinter: Handle ClassTemplateSpecialization and ClassTemplatePartialSpecialization declarations
  • DeclContextPrinter: Handle EmptyDecl
  • DeclContextPrinter: Handle UsingDecl
  • DeclContextPrinter: Handle FriendDecl

Thanks

Diff Detail

Repository
rL LLVM

Event Timeline

arphaman updated this revision to Diff 78848.Nov 22 2016, 4:17 AM
arphaman retitled this revision from to Handle more declarations in DeclContextPrinter to fix -print-decl-contexts crashes.
arphaman updated this object.
arphaman added reviewers: rsmith, mehdi_amini.
arphaman set the repository for this revision to rL LLVM.
arphaman added a subscriber: cfe-commits.
mehdi_amini accepted this revision.Dec 19 2016, 10:29 AM
mehdi_amini edited edge metadata.

Testing is in line with the existing testing.
It is not great, but at the same time is a development/debugging tool right?

This revision is now accepted and ready to land.Dec 19 2016, 10:29 AM
This revision was automatically updated to reflect the committed changes.