clang-tools
10.0.0git
|
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... | |
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 422 of file LoopConvertUtils.h.
Enumerator | |
---|---|
NS_CamelBack | |
NS_CamelCase | |
NS_LowerCase | |
NS_UpperCase |
Definition at line 425 of file LoopConvertUtils.h.
|
inline |
Definition at line 432 of file LoopConvertUtils.h.
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 843 of file LoopConvertUtils.cpp.