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
Paths
| Differential D35329
[clang-reorder-fields] Enable reordering for plain C structs ClosedPublic Authored by alexander-shaposhnikov 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, Test plan: make check-all
Diff Detail
Event Timeline
This revision is now accepted and ready to land.Jul 20 2017, 6:51 AM Closed by commit rL308678: [clang-tools-extra] Add support for plain C structs in clang-reorder-fields (authored by alexander-shaposhnikov). · Explain WhyJul 20 2017, 2:42 PM This revision was automatically updated to reflect the committed changes.
Revision Contents
Diff 107143 clang-reorder-fields/ReorderFieldsAction.cpp
test/clang-reorder-fields/PlainCStructFieldsOrder.c
|
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.