This is an archive of the discontinued LLVM Phabricator instance.

Take into account PrintingPolicy::SuppressUnwrittenScope in NamedDecl::printQualifiedName.
ClosedPublic

Authored by vsapsai on May 27 2014, 7:38 AM.

Details

Summary

This patch makes NamedDecl::printQualifiedName more like TypePrinter::AppendScope. I.e. it ignores anonymous and inline namespaces if PrintingPolicy::SuppressUnwrittenScope is true.

The actual change is simple and small. I have doubts about the added test. Don't know if it should be a unit test or a lit test. I've created unit test AST/NamedDeclPrinterTest.cpp based on AST/DeclPrinterTest.cpp and AST/StmtPrinterTest.cpp. I'll be glad to rework test to a more appropriate shape.

I've added Douglas Gregor as a reviewer because he has introduced SuppressUnwrittenScope flag in r143599. If it's a wrong decision, please, direct me to the right person.

Corresponding discussion on cfe-def mailing list can be found at http://lists.cs.uiuc.edu/pipermail/cfe-dev/2014-May/037029.html

Diff Detail

Event Timeline

vsapsai updated this revision to Diff 9836.May 27 2014, 7:38 AM
vsapsai retitled this revision from to Take into account PrintingPolicy::SuppressUnwrittenScope in NamedDecl::printQualifiedName..
vsapsai updated this object.
vsapsai edited the test plan for this revision. (Show Details)
vsapsai added a reviewer: doug.gregor.
vsapsai added a subscriber: Unknown Object (MLST).
rsmith accepted this revision.May 29 2014, 8:04 PM
rsmith added a reviewer: rsmith.
rsmith added a subscriber: rsmith.

LGTM

lib/AST/Decl.cpp
1307

Just use isInline here since you already know you've got a namespace.

This revision is now accepted and ready to land.May 29 2014, 8:04 PM
vsapsai updated this revision to Diff 9957.May 30 2014, 5:32 AM
vsapsai edited edge metadata.

Use isInline according to Richard's code review.

Eugene.Zelenko closed this revision.Oct 3 2016, 1:27 PM
Eugene.Zelenko added a subscriber: Eugene.Zelenko.

Committed in rL209924.