This is an archive of the discontinued LLVM Phabricator instance.

[clang-move] Don't dump macro symbols.
ClosedPublic

Authored by hokein on Feb 8 2018, 7:44 AM.

Diff Detail

Event Timeline

hokein created this revision.Feb 8 2018, 7:44 AM
ioeric added a comment.Feb 8 2018, 8:03 AM

Lg. Thanks for the change!

clang-move/ClangMove.cpp
526

I'd probably relax the condition a bit; theoretically tools would be able to handle entire identifiers that are either spelled in macro or passed in by users. But it's probably rare. Might worth a FIXME though?

unittests/clang-move/ClangMoveTests.cpp
397

Could you add a test case where the identifier is composed of macro and user parameter? Something like #define Foo(x) void func_##x()?

ioeric accepted this revision.Feb 9 2018, 3:43 AM

Ooops, forgot to stamp!

This revision is now accepted and ready to land.Feb 9 2018, 3:43 AM
hokein updated this revision to Diff 133621.Feb 9 2018, 7:51 AM
hokein marked an inline comment as done.

Add more tests.

hokein added inline comments.Feb 9 2018, 7:58 AM
clang-move/ClangMove.cpp
526

This mainly affects the dump behavior. Moving symbols spelled in macro is tricky, and we can't guarantee always doing right thing. Actually, clang-move supports it partially. For the test case of this patch, if you move the Foo (names=Foo), clang-move will move the expansion macro (DEFINE_Foo;), although Foo is not dumped.

This revision was automatically updated to reflect the committed changes.