Page MenuHomePhabricator

[clang-reorder-fields] Enable reordering for plain C structs
ClosedPublic

Authored by alexshap on Jul 12 2017, 2:40 PM.

Details

Summary

This diff adds support for reordering fields in structs when the code compiles as plain C,
in particular we switch to using RecordDecl instead of CXXRecordDecl where it's appropriate.

Test plan: make check-all

Diff Detail

Repository
rL LLVM

Event Timeline

alexshap created this revision.Jul 12 2017, 2:40 PM
hokein added inline comments.Jul 18 2017, 11:17 AM
clang-reorder-fields/ReorderFieldsAction.cpp
236 ↗(On Diff #106312)

Nit: missing a trailing ..

I think we could use Context.getLangOpts() to determine whether the file being processed is C or C++. Use early return If the code is C.

alexshap updated this revision to Diff 107143.Jul 18 2017, 11:30 AM

update the comments

hokein accepted this revision.Jul 20 2017, 6:51 AM

LGTM.

This revision is now accepted and ready to land.Jul 20 2017, 6:51 AM
This revision was automatically updated to reflect the committed changes.