Initializer lists with designators, missing elements or omitted braces
can now be rewritten. Any missing designators are added and they get
sorted according to the new order.
```
struct Foo {
int a;
int b;
int c;
};
struct Foo foo = { .a = 1, 2, 3 }
```
when reordering elements to "b,a,c" becomes:
```
struct Foo {
int b;
int a;
int c;
};
struct Foo foo = { .b = 2, .a = 1, .c = 3 }
```
27 lines
379 B
CMake
27 lines
379 B
CMake
set(LLVM_LINK_COMPONENTS
|
|
FrontendOpenMP
|
|
support
|
|
)
|
|
|
|
add_clang_library(clangReorderFields STATIC
|
|
Designator.cpp
|
|
ReorderFieldsAction.cpp
|
|
|
|
DEPENDS
|
|
omp_gen
|
|
ClangDriverOptions
|
|
)
|
|
|
|
clang_target_link_libraries(clangReorderFields
|
|
PRIVATE
|
|
clangAST
|
|
clangASTMatchers
|
|
clangBasic
|
|
clangIndex
|
|
clangLex
|
|
clangSerialization
|
|
clangToolingCore
|
|
)
|
|
|
|
add_subdirectory(tool)
|