This is an archive of the discontinued LLVM Phabricator instance.

[clang-move] Clever on handling header file which includes itself.
ClosedPublic

Authored by hokein on Jan 29 2018, 5:23 AM.

Details

Summary

Previously, we assume only old.cc includes "old.h", which would
introduce incorrect fixes for the cases where old.h also includes #include "old.h"

Although it should not be occurred in real projects, clang-move should handle this.

Old.h:

class Foo {};

after moving to a new old.h:

class Foo {};

Diff Detail

Event Timeline

hokein created this revision.Jan 29 2018, 5:23 AM
ioeric added inline comments.Jan 29 2018, 9:11 AM
clang-move/ClangMove.cpp
708

This check is always true?

868

I'd pull this into a lambda.

hokein updated this revision to Diff 132111.Jan 31 2018, 1:23 AM
hokein marked an inline comment as done.

address review comments.

hokein marked an inline comment as done.Jan 31 2018, 1:24 AM
hokein added inline comments.
clang-move/ClangMove.cpp
708

Oops, good catch, should be AbsoluteIncludeHeader.

This revision is now accepted and ready to land.Jan 31 2018, 3:28 AM
This revision was automatically updated to reflect the committed changes.