This is an archive of the discontinued LLVM Phabricator instance.

[clang-move] Move using-decl in old cc.
ClosedPublic

Authored by hokein on Oct 19 2016, 2:06 AM.

Details

Summary

Another fix is to move the whole anonymous namespace declaration
completely instead of moving fun/var declarations only.

Diff Detail

Repository
rL LLVM

Event Timeline

hokein updated this revision to Diff 75120.Oct 19 2016, 2:06 AM
hokein retitled this revision from to [clang-move] Move using-decl in old cc..
hokein updated this object.
hokein added a reviewer: ioeric.
hokein added a subscriber: cfe-commits.
ioeric added inline comments.Oct 19 2016, 2:14 AM
clang-move/ClangMove.cpp
356 ↗(On Diff #75120)

Is UsingDirectiveDecl, i.e. using namespace decl, included in this case?

366 ↗(On Diff #75120)

Seems that filters for functionDecl and varDecl are the same? Maybe apply them on namedDecl?

test/clang-move/Inputs/multiple_class_test.cpp
9 ↗(On Diff #75120)

Can you also add tests where using decls are in classes/functions?

hokein updated this revision to Diff 75139.Oct 19 2016, 6:40 AM
hokein marked 2 inline comments as done.

Address comments.

  • Cover type alias declarations.
  • Fix an issue of moving function-scope static definitions in non-moved classes.
hokein marked an inline comment as done.Oct 19 2016, 6:40 AM
hokein added inline comments.
clang-move/ClangMove.cpp
356 ↗(On Diff #75120)

Also covered type alias declarations.

366 ↗(On Diff #75120)

I tried it before, but some ast matchers are not available on nameDecl. I simplified the code a little bit by pulling out these filters.

ioeric accepted this revision.Oct 19 2016, 6:44 AM
ioeric edited edge metadata.

Lg

clang-move/ClangMove.cpp
372 ↗(On Diff #75139)

s/named spaces/named namespaces/ ?

This revision is now accepted and ready to land.Oct 19 2016, 6:44 AM
This revision was automatically updated to reflect the committed changes.
hokein marked 2 inline comments as done.