clang-tools 22.0.0git
|
List of designators. More...
#include <Designator.h>
Public Member Functions | |
Designators (const Expr *Init, const InitListExpr *ILE, const ASTContext *Context) | |
Initialize to the first member of the struct/array. | |
Designators (const DesignatedInitExpr *DIE, const InitListExpr *ILE, const ASTContext *Context) | |
Initialize to the designators of the given expression. | |
bool | isValid () const |
Return whether this designator list is valid. | |
bool | advanceToNextField (const Expr *Init) |
Moves the designators to the next initializer in the struct/array. | |
std::string | toString () const |
Gets a string representation from a list of designators. | |
size_t | size () const |
SmallVector< Designator >::const_iterator | begin () const |
SmallVector< Designator >::const_iterator | end () const |
List of designators.
Definition at line 120 of file Designator.h.
clang::reorder_fields::Designators::Designators | ( | const Expr * | Init, |
const InitListExpr * | ILE, | ||
const ASTContext * | Context ) |
Initialize to the first member of the struct/array.
Enters implicit initializer lists until a type that matches Init is found.
Definition at line 63 of file Designator.cpp.
Referenced by Designators().
clang::reorder_fields::Designators::Designators | ( | const DesignatedInitExpr * | DIE, |
const InitListExpr * | ILE, | ||
const ASTContext * | Context ) |
Initialize to the designators of the given expression.
Definition at line 91 of file Designator.cpp.
References Designators().
bool clang::reorder_fields::Designators::advanceToNextField | ( | const Expr * | Init | ) |
Moves the designators to the next initializer in the struct/array.
If the type of next initializer doesn't match the expected type then there are omitted braces and we add new designators to reflect that.
Definition at line 138 of file Designator.cpp.
References advanceToNextField().
Referenced by advanceToNextField().
|
inline |
Definition at line 145 of file Designator.h.
Referenced by clang::reorder_fields::ReorderedStruct::operator()().
|
inline |
Definition at line 148 of file Designator.h.
Referenced by clang::reorder_fields::ReorderedStruct::operator()().
|
inline |
Return whether this designator list is valid.
Definition at line 132 of file Designator.h.
|
inline |
Definition at line 143 of file Designator.h.
std::string clang::reorder_fields::Designators::toString | ( | ) | const |
Gets a string representation from a list of designators.
This string will be inserted before an initializer expression to make it designated.
Definition at line 196 of file Designator.cpp.
References clang::reorder_fields::Designator::ARRAY, clang::reorder_fields::Designator::ARRAY_RANGE, clang::reorder_fields::Designator::STRUCT, and toString().
Referenced by toString().