-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Commit ac74d9e
authored
[clang][NFC] Regroup declarations in
This patch regroups declarations in `Sema` based on the file they are
implemented in (e.g. `SemaChecking.cpp`). This allows to logically split
`Sema` in 42 groups. No physical separation is done (e.g. splitting
`Sema` into multiple classes). Table of contents added at the very
beginning of `Sema`. Grouping is reflected in Doxygen commands, so
structure of API reference of `Sema` is also significantly improved
([example from official
documentation](https://www.doxygen.nl/manual/examples/memgrp/html/class_memgrp___test.html),
[comparison of Sema API
reference](#82217 (comment))).
While grouping is intentional, as well as each group consisting of
`public` declarations followed by `private` ones (without changing
access in-between), exact contents and order of declarations of each
group is partially carried over from old structure, partially accidental
due to time constrains to do the regrouping over the weekend (`Sema` is
just enormously big). Data members and inline function definitions in
`Sema.h` complicate the matter, since it's not obvious which group they
belong to. Further work is expected to refine contents and order of
declarations.
What is also intentional is some kind of layering, where Concepts group
follows template groups, and ObjC, code completion, CUDA, HLSL, OpenACC,
OpenMP, and SYCL are all placed at the end of the file, after C and C++
parts of `Sema`.
I used `clang-query` to verify that access specifiers were preserved
during the process (https://gcc.godbolt.org/z/9johffY9T, thank you
@ilya-biryukov). Only the following 3 member types were converted from
`private` to `public` because of limitations of the new grouping:
`DeclareTargetContextInfo`, `TypoExprState`, `SatisfactionStackEntryTy`.
Member initializer list of `Sema` in `Sema.cpp` is rewritten to reflect
new order of data members in order to avoid `-Wreorder-ctor`.
Since this patch touches almost every line in `Sema.h`, it was
considered appropriate to run clang-format on the whole file, and not
just on changed lines.Sema
(#82217)1 parent 471a612 commit ac74d9eCopy full SHA for ac74d9e
0 commit comments