This is an archive of the discontinued LLVM Phabricator instance.

[clang-move] Enable dump all declarations in old header.
ClosedPublic

Authored by hokein on Nov 23 2016, 9:58 AM.

Details

Summary
  • Add -dump_dels option to dump all declarations from old header. It will allow clang-move used as a frontend to get declarations from header. Further more, this will make debugging stuff easier.Currently only support dumpng class/function types.
  • Refactoring code a little bit by creating a ClangMoveContext which holds all options for ClangMoveTool, which can simplify the code in some degree.

Diff Detail

Repository
rL LLVM

Event Timeline

hokein updated this revision to Diff 79119.Nov 23 2016, 9:58 AM
hokein updated this revision to Diff 79120.
hokein retitled this revision from to [clang-move] Enable dump all declarations in old header..
hokein updated this object.
hokein added a reviewer: ioeric.
hokein added a subscriber: cfe-commits.

Code style.

ioeric added inline comments.Nov 23 2016, 10:58 PM
clang-move/ClangMove.h
90 ↗(On Diff #79120)

Is this the right place for this comment? Seems a bit unexpected.

unittests/clang-move/ClangMoveTests.cpp
522 ↗(On Diff #79120)

What if Reporter.getDeclarationList().size() > ExpectedDeclaration.size().

I'd use iterator-based loop on both vectors and assert both iterators reached end after loop.

hokein updated this revision to Diff 79194.Nov 24 2016, 1:34 AM
hokein marked 2 inline comments as done.

Add comments && Update test.

ioeric edited edge metadata.Nov 24 2016, 1:48 AM

LG with a nit.

clang-move/tool/ClangMoveMain.cpp
155 ↗(On Diff #79194)

This check is run in each iteration... maybe just loop from begin() to end()-1 and special casing the last element, in which case you don't need to check in each run.

ioeric accepted this revision.Nov 24 2016, 1:48 AM
ioeric edited edge metadata.
This revision is now accepted and ready to land.Nov 24 2016, 1:48 AM
This revision was automatically updated to reflect the committed changes.