This is an archive of the discontinued LLVM Phabricator instance.

[change-namespace] consider namespace aliases to shorten qualified names.
ClosedPublic

Authored by ioeric on Dec 22 2016, 3:08 AM.

Event Timeline

ioeric updated this revision to Diff 82322.Dec 22 2016, 3:08 AM
ioeric retitled this revision from to [change-namespace] consider namespace aliases to shorten qualified names..
ioeric updated this object.
ioeric added a reviewer: hokein.
ioeric added a subscriber: cfe-commits.
hokein added inline comments.Dec 22 2016, 7:45 AM
change-namespace/ChangeNamespace.cpp
719

maybe assert(StringRef(AliasQualifiedName).end_with("::"+AliasName))?

741

Do we also need to check FromDecl->getNameAsString().size() < ReplaceName.size() before assigning the name to ReplaceName?

unittests/change-namespace/ChangeNamespaceTests.cpp
832

Add a testcase for the namespace alias decl with preceding ::, e.g. namespace gl = ::glob?

ioeric updated this revision to Diff 82345.Dec 22 2016, 9:04 AM
ioeric marked 3 inline comments as done.
  • addressed review comments.
hokein accepted this revision.Dec 23 2016, 2:15 AM
hokein edited edge metadata.

LGTM.

This revision is now accepted and ready to land.Dec 23 2016, 2:15 AM
This revision was automatically updated to reflect the committed changes.