clang-tools 3.8.0

- Main Page
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | List of all members
clang::tidy::modernize::VariableNamer Class Reference

Create names for generated variables within a particular statement. More...

`#include <LoopConvertUtils.h>`

## Public Types
enum | NamingStyle { NS_CamelBack, NS_CamelCase, NS_LowerCase, NS_UpperCase }

## Public Member Functions
| VariableNamer (StmtGeneratedVarNameMap *GeneratedDecls, const StmtParentMap *ReverseAST, const clang::Stmt *SourceStmt, const clang::VarDecl *OldIndex, const clang::ValueDecl *TheContainer, const clang::ASTContext *Context, NamingStyle Style)
std::string | createIndexName ()
| Generate a new index name. More...

## Detailed Description

Create names for generated variables within a particular statement.

VariableNamer uses a DeclContext as a reference point, checking for any conflicting declarations higher up in the context or within SourceStmt. It creates a variable name using hints from a source container and the old index, if they exist.

Definition at line 415 of file LoopConvertUtils.h.

## Member Enumeration Documentation

enum clang::tidy::modernize::VariableNamer::NamingStyle

Enumerator
NS_CamelBack |
NS_CamelCase |
NS_LowerCase |
NS_UpperCase |

Definition at line 418 of file LoopConvertUtils.h.

## Constructor & Destructor Documentation

clang::tidy::modernize::VariableNamer::VariableNamer | ( | StmtGeneratedVarNameMap * | GeneratedDecls,
|  | const StmtParentMap * | ReverseAST,
|  | const clang::Stmt * | SourceStmt,
|  | const clang::VarDecl * | OldIndex,
|  | const clang::ValueDecl * | TheContainer,
|  | const clang::ASTContext * | Context,
|  | NamingStyle | Style
| ) |  |
| inline

Definition at line 425 of file LoopConvertUtils.h.

## Member Function Documentation

std::string clang::tidy::modernize::VariableNamer::createIndexName | ( |  | ) |

Generate a new index name.

Generates the name to be used for an inserted iterator. It relies on declarationExists() to determine that there are no naming conflicts, and tries to use some hints from the container name and the old index name.

Definition at line 816 of file LoopConvertUtils.cpp.

References NS_UpperCase.

The documentation for this class was generated from the following files:

- LoopConvertUtils.h
- LoopConvertUtils.cpp