clang-tools 8.0.0

Namespaces | Functions
ReorderFieldsAction.cpp File Reference

This file contains the definition of the ReorderFieldsAction::newASTConsumer method. More...

`#include "ReorderFieldsAction.h"`
`#include "clang/AST/AST.h"`
`#include "clang/AST/ASTConsumer.h"`
`#include "clang/AST/ASTContext.h"`
`#include "clang/AST/Decl.h"`
`#include "clang/AST/RecursiveASTVisitor.h"`
`#include "clang/ASTMatchers/ASTMatchFinder.h"`
`#include "clang/Lex/Lexer.h"`
`#include "clang/Tooling/Refactoring.h"`
`#include "llvm/ADT/SetVector.h"`
`#include <algorithm>`
`#include <string>`
Include dependency graph for ReorderFieldsAction.cpp:

Go to the source code of this file.

## Namespaces
| clang
| ===– Representation.cpp - ClangDoc Representation --------—*- C++ -*-===//
| clang::reorder_fields

## Functions
static const RecordDecl * | clang::reorder_fields::findDefinition (StringRef RecordName, ASTContext &Context)
| Finds the definition of a record by name. More...
static SmallVector< unsigned, 4 > | clang::reorder_fields::getNewFieldsOrder (const RecordDecl *Definition, ArrayRef< std::string > DesiredFieldsOrder)
| Calculates the new order of fields. More...
static void | clang::reorder_fields::addReplacement (SourceRange Old, SourceRange New, const ASTContext &Context, std::map< std::string, tooling::Replacements > &Replacements)
| Replaces one range of source code by another. More...
static SmallSetVector< FieldDecl *, 1 > | clang::reorder_fields::findMembersUsedInInitExpr (const CXXCtorInitializer *Initializer, ASTContext &Context)
| Find all member fields used in the given init-list initializer expr that belong to the same record. More...
static bool | clang::reorder_fields::reorderFieldsInDefinition (const RecordDecl *Definition, ArrayRef< unsigned > NewFieldsOrder, const ASTContext &Context, std::map< std::string, tooling::Replacements > &Replacements)
| Reorders fields in the definition of a struct/class. More...
static void | clang::reorder_fields::reorderFieldsInConstructor (const CXXConstructorDecl *CtorDecl, ArrayRef< unsigned > NewFieldsOrder, ASTContext &Context, std::map< std::string, tooling::Replacements > &Replacements)
| Reorders initializers in a C++ struct/class constructor. More...
static bool | clang::reorder_fields::reorderFieldsInInitListExpr (const InitListExpr *InitListEx, ArrayRef< unsigned > NewFieldsOrder, const ASTContext &Context, std::map< std::string, tooling::Replacements > &Replacements)
| Reorders initializers in the brace initialization of an aggregate. More...

## Detailed Description

This file contains the definition of the ReorderFieldsAction::newASTConsumer method.

Definition in file ReorderFieldsAction.cpp.