[PATCH] D23279: clang-reorder-fields

Alexander Shaposhnikov via cfe-commits cfe-commits at lists.llvm.org
Wed Aug 24 17:16:26 PDT 2016


alexshap updated this revision to Diff 69186.
alexshap added a comment.

Use a more elaborate approach for command line options.

alexshap-mbp:srcs alexshap$ clang-reorder-fields -record-name Foo -fields-order s1,x,z,s2 main.cpp >/dev/null && echo ok
ok
alexshap-mbp:srcs alexshap$ clang-reorder-fields -fields-order s1,x,z,s2 main.cpp >/dev/null && echo ok
clang-reorder-fields: for the -record-name option: must be specified at least once!
alexshap-mbp:srcs alexshap$ clang-reorder-fields -record-name Foo main.cpp >/dev/null && echo ok
clang-reorder-fields: for the -fields-order option: must be specified at least once!
alexshap-mbp:srcs alexshap$ clang-reorder-fields --help
OVERVIEW: A tool to reorder fields in C/C++ structs/classes.

USAGE: clang-reorder-fields [subcommand] [options] <source0> [... <sourceN>]

OPTIONS:

Generic Options:

  -help                      - Display available options (-help-hidden for more)
  -help-list                 - Display list of available options (-help-list-hidden for more)
  -version                   - Display the version of this program

clang-reorder-fields options:

  -extra-arg=<string>        - Additional argument to append to the compiler command line
  -extra-arg-before=<string> - Additional argument to prepend to the compiler command line
  -fields-order=<string>     - The desired fields order.
  -i                         - Overwrite edited files.
  -p=<string>                - Build path
  -record-name=<string>      - The name of the struct/class.


Repository:
  rL LLVM

https://reviews.llvm.org/D23279

Files:
  CMakeLists.txt
  clang-reorder-fields/CMakeLists.txt
  clang-reorder-fields/ReorderFieldsAction.cpp
  clang-reorder-fields/ReorderFieldsAction.h
  clang-reorder-fields/tool/CMakeLists.txt
  clang-reorder-fields/tool/ClangReorderFields.cpp
  test/CMakeLists.txt
  test/clang-reorder-fields/CStructAmbiguousName.cpp
  test/clang-reorder-fields/CStructFieldsOrder.cpp
  test/clang-reorder-fields/ClassMixedInitialization.cpp
  test/clang-reorder-fields/ClassSimpleCtor.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D23279.69186.patch
Type: text/x-patch
Size: 19743 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20160825/50152a37/attachment-0001.bin>


More information about the cfe-commits mailing list