More or less the heart of C++ Insights. More...
#include "CodeGenerator.h"
Classes | |
class | LambdaHelper |
class | LambdaScopeHandler |
Public Member Functions | |
constexpr | CodeGenerator (OutputFormatHelper &_outputFormatHelper) |
constexpr | CodeGenerator (OutputFormatHelper &_outputFormatHelper, LambdaInInitCapture lambdaInitCapture) |
constexpr | CodeGenerator (OutputFormatHelper &_outputFormatHelper, LambdaStackType &lambdaStack, ProcessingPrimaryTemplate processingPrimaryTemplate) |
virtual | ~CodeGenerator ()=default |
virtual void | InsertArg (const Decl *stmt) |
virtual void | InsertArg (const Stmt *stmt) |
template<typename T > | |
void | InsertTemplateArgs (const T &t) |
void | InsertTemplateArgs (const ClassTemplateSpecializationDecl &clsTemplateSpe) |
void | InsertFunctionNameWithReturnType (const FunctionDecl &decl, const CXXConstructorDecl *cxxInheritedCtorDecl=nullptr) |
Insert the code for a FunctionDecl. More... | |
template<typename T > | |
void | InsertTemplateArgs (const ArrayRef< T > &array) |
void | InsertAttributes (const Decl *) |
void | InsertAttributes (const Decl::attr_range &) |
void | InsertAttribute (const Attr &) |
void | InsertTemplateArg (const TemplateArgument &arg) |
STRONG_BOOL (TemplateParamsOnly) | |
void | InsertTemplateParameters (const TemplateParameterList &list, const TemplateParamsOnly templateParamsOnly=TemplateParamsOnly::No) |
! Skip template, type constraints and class/typename. More... | |
void | StartLifetimeScope () |
void | LifetimeAddExtended (const VarDecl *, const ValueDecl *) |
void | EndLifetimeScope () |
Public Attributes | |
const Decl * | mLastDecl {} |
Protected Types | |
enum class | LambdaCallerType { VarDecl , InitCapture , CallExpr , OperatorCallExpr , MemberCallExpr , LambdaExpr , ReturnStmt , BinaryOperator , CXXMethodDecl , TemplateHead , Decltype } |
enum class | BraceKind { Parens , Curlys } |
using | LambdaStackType = StackList< class LambdaHelper > |
Protected Member Functions | |
STRONG_BOOL (LambdaInInitCapture) | |
STRONG_BOOL (ProcessingPrimaryTemplate) | |
constexpr | CodeGenerator (OutputFormatHelper &_outputFormatHelper, LambdaStackType &lambdaStack, LambdaInInitCapture lambdaInitCapture, ProcessingPrimaryTemplate processingPrimaryTemplate) |
! We do not want to transform a primary template which contains a Coroutine. More... | |
virtual bool | InsertVarDecl (const VarDecl *) |
virtual bool | SkipSpaceAfterVarDecl () |
virtual bool | InsertComma () |
virtual bool | InsertSemi () |
virtual bool | InsertNamespace () const |
virtual bool | ShowXValueCasts () const |
Show casts to xvalues independent from the show all casts option. More... | |
void | HandleTemplateParameterPack (const ArrayRef< TemplateArgument > &args) |
void | HandleCompoundStmt (const CompoundStmt *stmt) |
void | HandleLocalStaticNonTrivialClass (const VarDecl *stmt) |
Show what is behind a local static variable. More... | |
virtual void | FormatCast (const std::string_view castName, const QualType &CastDestType, const Expr *SubExpr, const CastKind &castKind) |
void | ForEachArg (const auto &arguments, auto &&lambda) |
void | InsertArgWithParensIfNeeded (const Stmt *stmt) |
void | InsertSuffix (const QualType &type) |
void | InsertTemplateArg (const TemplateArgumentLoc &arg) |
bool | InsertLambdaStaticInvoker (const CXXMethodDecl *cxxMethodDecl) |
STRONG_BOOL (InsertInline) | |
void | InsertConceptConstraint (const llvm::SmallVectorImpl< const Expr * > &constraints, const InsertInline insertInline) |
void | InsertConceptConstraint (const FunctionDecl *tmplDecl) |
void | InsertConceptConstraint (const VarDecl *varDecl) |
void | InsertConceptConstraint (const TemplateParameterList &tmplDecl) |
void | InsertTemplate (const FunctionTemplateDecl *, bool withSpec) |
void | InsertQualifierAndNameWithTemplateArgs (const DeclarationName &declName, const auto *stmt) |
void | InsertQualifierAndName (const DeclarationName &declName, const NestedNameSpecifier *qualifier, const bool hasTemplateKeyword) |
void | InsertCXXMethodHeader (const CXXMethodDecl *stmt, OutputFormatHelper &initOutputFormatHelper) |
void | InsertTemplateGuardBegin (const FunctionDecl *stmt) |
void | InsertTemplateGuardEnd (const FunctionDecl *stmt) |
void | InsertTemplateSpecializationHeader (const Decl &) |
Insert template<> to introduce a template specialization. More... | |
void | InsertTemplateArgsObjectParam (const ArrayRef< TemplateArgument > &array) |
void | InsertTemplateArgsObjectParam (const TemplateParamObjectDecl ¶m) |
void | InsertNamespace (const NestedNameSpecifier *namespaceSpecifier) |
void | ParseDeclContext (const DeclContext *Ctx) |
STRONG_BOOL (SkipBody) | |
virtual void | InsertCXXMethodDecl (const CXXMethodDecl *stmt, SkipBody skipBody) |
void | InsertMethodBody (const FunctionDecl *stmt, const size_t posBeforeFunc) |
template<typename T > | |
void | InsertConstructorExpr (const T *stmt) |
Generalized function to insert either a CXXConstructExpr or CXXUnresolvedConstructExpr . More... | |
void | InsertCurlysIfRequired (const Stmt *stmt) |
Check whether or not this statement will add curlys or parentheses and add them only if required. More... | |
void | InsertIfOrSwitchInitVariables (same_as_any_of< const IfStmt, const SwitchStmt > auto *stmt) |
void | InsertInstantiationPoint (const SourceManager &sm, const SourceLocation &instLoc, std::string_view text={}) |
Inserts the instantiation point of a template. More... | |
STRONG_BOOL (AddNewLineAfter) | |
void | WrapInCompoundIfNeeded (const Stmt *stmt, const AddNewLineAfter addNewLineAfter) |
STRONG_BOOL (AddSpaceAtTheEnd) | |
void | WrapInParens (void_func_ref lambda, const AddSpaceAtTheEnd addSpaceAtTheEnd=AddSpaceAtTheEnd::No) |
void | WrapInParensIfNeeded (bool needsParens, void_func_ref lambda, const AddSpaceAtTheEnd addSpaceAtTheEnd=AddSpaceAtTheEnd::No) |
void | WrapInCurliesIfNeeded (bool needsParens, void_func_ref lambda, const AddSpaceAtTheEnd addSpaceAtTheEnd=AddSpaceAtTheEnd::No) |
void | WrapInCurlys (void_func_ref lambda, const AddSpaceAtTheEnd addSpaceAtTheEnd=AddSpaceAtTheEnd::No) |
void | WrapInParensOrCurlys (const BraceKind curlys, void_func_ref lambda, const AddSpaceAtTheEnd addSpaceAtTheEnd=AddSpaceAtTheEnd::No) |
void | UpdateCurrentPos (std::optional< size_t > &pos) |
void | HandleLambdaExpr (const LambdaExpr *stmt, LambdaHelper &lambdaHelper) |
bool | InsideDecltype () const |
STRONG_BOOL (SkipVarDecl) | |
STRONG_BOOL (UseCommaInsteadOfSemi) | |
STRONG_BOOL (NoEmptyInitList) | |
STRONG_BOOL (ShowConstantExprValue) | |
Static Protected Member Functions | |
static std::string_view | GetBuiltinTypeSuffix (const BuiltinType::Kind &kind) |
static std::string | FillConstantArray (const ConstantArrayType *ct, const std::string &value, const uint64_t startAt) |
static std::string | GetValueOfValueInit (const QualType &t) |
Protected Attributes | |
LifetimeTracker | mLifeTimeTracker {} |
const Stmt * | mLastStmt {} |
const Expr * | mLastExpr {} |
bool | mProcessingVarDecl {} |
OutputFormatHelper & | mOutputFormatHelper |
LambdaStackType | mLambdaStackThis |
LambdaStackType & | mLambdaStack |
LambdaInInitCapture | mLambdaInitCapture {LambdaInInitCapture::No} |
ShowConstantExprValue | mShowConstantExprValue {ShowConstantExprValue::No} |
SkipVarDecl | mSkipVarDecl {SkipVarDecl::No} |
UseCommaInsteadOfSemi | mUseCommaInsteadOfSemi {UseCommaInsteadOfSemi::No} |
NoEmptyInitList | mNoEmptyInitList |
At least in case if a requires-clause containing T{} we don't want to get T{{}}. More... | |
const LambdaExpr * | mLambdaExpr {} |
std::optional< size_t > | mCurrentVarDeclPos {} |
std::optional< size_t > | mCurrentCallExprPos {} |
std::optional< size_t > | mCurrentReturnPos {} |
std::optional< size_t > | mCurrentFieldPos {} |
OutputFormatHelper * | mOutputFormatHelperOutside |
Helper output buffer for std::initializer_list expansion. More... | |
bool | mRequiresImplicitReturnZero {} |
Track whether this is a function with an imlpicit return 0. More... | |
bool | mSkipSemi {} |
ProcessingPrimaryTemplate | mProcessingPrimaryTemplate {} |
Static Protected Attributes | |
static constexpr auto | MAX_FILL_VALUES_FOR_ARRAYS |
static std::map< std::string, bool > | mSeenDecls {} |
Friends | |
class | CodeGeneratorVariant |
More or less the heart of C++ Insights.
This is the place where nearly all of the transformations happen. This class knows the needed types and how to generated code from them.
Definition at line 90 of file CodeGenerator.h.
|
protected |
Definition at line 166 of file CodeGenerator.h.
|
strongprotected |
Enumerator | |
---|---|
Parens | |
Curlys |
Definition at line 381 of file CodeGenerator.h.
|
strongprotected |
Enumerator | |
---|---|
VarDecl | |
InitCapture | |
CallExpr | |
OperatorCallExpr | |
MemberCallExpr | |
LambdaExpr | |
ReturnStmt | |
BinaryOperator | |
CXXMethodDecl | |
TemplateHead | |
Decltype |
Definition at line 106 of file CodeGenerator.h.
|
inlineconstexprprotected |
! We do not want to transform a primary template which contains a Coroutine.
Definition at line 174 of file CodeGenerator.h.
|
inlineexplicitconstexpr |
Definition at line 186 of file CodeGenerator.h.
|
inlineconstexpr |
Definition at line 191 of file CodeGenerator.h.
|
inlineconstexpr |
Definition at line 196 of file CodeGenerator.h.
|
virtualdefault |
void clang::insights::CodeGenerator::EndLifetimeScope | ( | ) |
Definition at line 1189 of file CodeGenerator.cpp.
References clang::insights::LifetimeTracker::EndScope(), mLifeTimeTracker, mOutputFormatHelper, and mSkipSemi.
Referenced by clang::insights::TemporaryDeclFinder::~TemporaryDeclFinder().
|
staticprotected |
Fill the values of a constant array.
This is either called by InitListExpr
(which may contain an offset, as the user already provided certain values) or by GetValueOfValueInit
.
Definition at line 1918 of file CodeGenerator.cpp.
References clang::insights::for_each(), clang::insights::GetSize(), and MAX_FILL_VALUES_FOR_ARRAYS.
|
inlineprotected |
Definition at line 310 of file CodeGenerator.h.
References clang::insights::OutputFormatHelper::ForEachArg(), and mOutputFormatHelper.
Referenced by InsertTemplateArgs().
|
protectedvirtual |
Reimplemented in clang::insights::CfrontCodeGenerator.
Definition at line 4487 of file CodeGenerator.cpp.
References clang::insights::is< T >::any_of(), clang::insights::details::GetName(), and clang::insights::details::StrCat().
|
staticprotected |
Definition at line 4709 of file CodeGenerator.cpp.
References CASE.
|
staticprotected |
Definition at line 2975 of file CodeGenerator.cpp.
References clang::insights::Error(), kwFalse, and kwNullptr.
|
protected |
Definition at line 2453 of file CodeGenerator.cpp.
References clang::insights::IsStmtRequiringSemi().
|
protected |
Definition at line 4728 of file CodeGenerator.cpp.
References clang::insights::OutputFormatHelper::AppendNewLine(), clang::insights::CodeGenerator::LambdaHelper::buffer(), InsertArg(), and mLambdaExpr.
|
protected |
Show what is behind a local static variable.
[stmt.dcl] p4: Initialization of a block-scope variable with static storage duration is thread-safe since C++11. Regardless of that, as long as it is a non-trivally construct and destructable class the compiler adds code to track the initialization state. Reference:
Definition at line 4594 of file CodeGenerator.cpp.
References clang::insights::asthelpers::StmtsContainer::AddBodyStmts(), clang::insights::asthelpers::And(), clang::insights::asthelpers::Assign(), clang::insights::asthelpers::Bool(), clang::insights::BuildInternalVarName(), clang::insights::asthelpers::Call(), clang::insights::asthelpers::Catch(), clang::insights::asthelpers::Comment(), clang::insights::EnableGlobalInsert(), clang::insights::asthelpers::Equal(), GetGlobalAST(), clang::insights::GetLangOpts(), clang::insights::details::GetName(), clang::insights::asthelpers::If(), clang::insights::asthelpers::Int32(), clang::insights::asthelpers::mkCompoundStmt(), clang::insights::asthelpers::New(), clang::insights::asthelpers::Ref(), clang::insights::asthelpers::Sizeof(), clang::insights::details::StrCat(), clang::insights::asthelpers::Throw(), clang::insights::asthelpers::Try(), clang::insights::asthelpers::Typedef(), and clang::insights::asthelpers::Variable().
|
protected |
Definition at line 4541 of file CodeGenerator.cpp.
|
virtual |
Definition at line 4446 of file CodeGenerator.cpp.
References clang::insights::ToDo().
Referenced by clang::insights::EmitGlobalVariableCtors(), clang::insights::GetNoExcept(), HandleLambdaExpr(), clang::insights::CfrontCodeGenerator::InsertArg(), clang::insights::CoroutinesCodeGenerator::InsertArg(), clang::insights::LambdaInitCaptureCodeGenerator::InsertArg(), clang::insights::UsingCodeGenerator::InsertArg(), InsertCXXMethodHeader(), InsertMethodBody(), InsertTemplateParameters(), clang::insights::TemporaryDeclFinder::TemporaryDeclFinder(), and clang::insights::CoroutinesCodeGenerator::~CoroutinesCodeGenerator().
|
virtual |
Definition at line 4464 of file CodeGenerator.cpp.
References clang::insights::DPrint(), and clang::insights::ToDo().
|
protected |
Definition at line 4503 of file CodeGenerator.cpp.
void clang::insights::CodeGenerator::InsertAttribute | ( | const Attr & | attr | ) |
Definition at line 3747 of file CodeGenerator.cpp.
References clang::insights::Ellipsis(), GetGlobalAST(), clang::insights::details::GetName(), kwAlignof, and RETURN_IF.
void clang::insights::CodeGenerator::InsertAttributes | ( | const Decl * | stmt | ) |
Definition at line 3728 of file CodeGenerator.cpp.
Referenced by clang::insights::OutputFormatHelper::AppendParameterList().
void clang::insights::CodeGenerator::InsertAttributes | ( | const Decl::attr_range & | attrs | ) |
Definition at line 3738 of file CodeGenerator.cpp.
|
inlineprotectedvirtual |
Reimplemented in clang::insights::MultiStmtDeclCodeGenerator.
Definition at line 286 of file CodeGenerator.h.
|
protected |
Definition at line 4772 of file CodeGenerator.cpp.
|
protected |
Definition at line 4742 of file CodeGenerator.cpp.
References kwRequiresSpace.
Referenced by InsertTemplateParameters().
|
protected |
Definition at line 4761 of file CodeGenerator.cpp.
|
protected |
Definition at line 4782 of file CodeGenerator.cpp.
References kwCCommentEndSpace, and kwCommentStart.
|
protected |
Generalized function to insert either a CXXConstructExpr
or CXXUnresolvedConstructExpr
.
Definition at line 2002 of file CodeGenerator.cpp.
References CONDITIONAL_LAMBDA_SCOPE_HELPER, clang::insights::details::GetName(), RETURN_IF, and clang::insights::ValueOr().
|
protected |
Check whether or not this statement will add curlys or parentheses and add them only if required.
Definition at line 5044 of file CodeGenerator.cpp.
Referenced by InsertCXXMethodHeader().
|
protectedvirtual |
Definition at line 3243 of file CodeGenerator.cpp.
References kwReturn, and clang::insights::OutputFormatHelper::SetIndent().
|
protected |
For a special case, when a LambdaExpr occurs in a Constructor from an in class initializer, there is a need for a more narrow scope for the LAMBDA_SCOPE_HELPER
.
Definition at line 3162 of file CodeGenerator.cpp.
References clang::insights::OutputFormatHelper::Append(), clang::insights::OutputFormatHelper::AppendNewLine(), clang::insights::GetUnqualifiedScopelessName(), InsertArg(), InsertCurlysIfRequired(), LAMBDA_SCOPE_HELPER, mCurrentCallExprPos, mCurrentFieldPos, mCurrentVarDeclPos, mOutputFormatHelperOutside, WrapInCurliesIfNeeded(), WrapInParens(), and WrapInParensOrCurlys().
void clang::insights::CodeGenerator::InsertFunctionNameWithReturnType | ( | const FunctionDecl & | decl, |
const CXXConstructorDecl * | cxxInheritedCtorDecl = nullptr |
||
) |
Insert the code for a FunctionDecl.
This inserts the code of a FunctionDecl (and everything which is derived from one). It takes care of CXXMethodDecl's access modifier as well as things like constexpr, noexcept, static and more.
decl | The FunctionDecl to process. |
skipAccess | Show or hide access modifiers (public, private, protected). The default is to show them. |
cxxInheritedCtorDecl | If not null, the type and name of this decl is used for the parameters. |
Definition at line 4794 of file CodeGenerator.cpp.
References clang::insights::OutputFormatHelper::Append(), clang::insights::OutputFormatHelper::AppendParameterList(), clang::insights::BuildRetTypeName(), clang::insights::GetConst(), clang::insights::GetDesugarReturnType(), GetInsightsOptions(), clang::insights::details::GetName(), clang::insights::GetNoExcept(), clang::insights::GetStorageClassAsStringWithSpace(), clang::insights::OutputFormatHelper::GetString(), clang::insights::GetType(), clang::insights::GetTypeNameAsParameter(), hlpAssing, InsertTemplateArgs(), clang::insights::IsStaticStorageClass(), kwCCommentEndSpace, kwCommentStart, kwConstEvalSpace, kwConstExprSpace, kwCppCommentStartSpace, kwExplicit, kwExplicitSpace, kwFriendSpace, kwInlineSpace, kwOperatorSpace, kwSpaceEqualsDefault, kwSpaceEqualsDelete, kwSpaceFinal, kwSpaceVolatile, kwStaticSpace, kwUsingSpace, and kwVirtualSpace.
|
protected |
Definition at line 2481 of file CodeGenerator.cpp.
|
protected |
Inserts the instantiation point of a template.
Definition at line 1531 of file CodeGenerator.cpp.
References clang::insights::OutputFormatHelper::AppendCommentNewLine(), and mOutputFormatHelper.
Referenced by clang::insights::CoroutinesCodeGenerator::InsertArg(), and InsertTemplateGuardBegin().
|
protected |
Definition at line 1479 of file CodeGenerator.cpp.
References clang::insights::OutputFormatHelper::Append(), clang::insights::OutputFormatHelper::AppendNewLine(), clang::insights::OutputFormatHelper::AppendParameterList(), clang::insights::OutputFormatHelper::AppendSemiNewLine(), clang::insights::OutputFormatHelper::CloseScope(), clang::insights::GetName(), InsertTemplateArgs(), InsertTemplateParameters(), kwReturn, mOutputFormatHelper, clang::insights::OutputFormatHelper::OpenScope(), and WrapInParens().
|
protected |
Definition at line 1616 of file CodeGenerator.cpp.
References clang::insights::LifetimeTracker::Add(), clang::insights::is< T >::any_of(), clang::insights::OutputFormatHelper::AppendNewLine(), clang::insights::OutputFormatHelper::AppendSemiNewLine(), clang::insights::asthelpers::Call(), clang::insights::asthelpers::Catch(), clang::insights::EnableGlobalInsert(), GetInsightsOptions(), clang::insights::HeaderException, InsertArg(), clang::insights::asthelpers::mkCompoundStmt(), mLifeTimeTracker, mOutputFormatHelper, mProcessingPrimaryTemplate, mRequiresImplicitReturnZero, and clang::insights::asthelpers::Try().
|
inlineprotectedvirtual |
Reimplemented in clang::insights::UsingCodeGenerator.
Definition at line 288 of file CodeGenerator.h.
|
protected |
Definition at line 395 of file CodeGenerator.cpp.
References clang::insights::OutputFormatHelper::Append(), clang::insights::GetNestedName(), mOutputFormatHelper, and clang::insights::ScopeHandler::RemoveCurrentScope().
|
protected |
Definition at line 385 of file CodeGenerator.cpp.
References clang::insights::OutputFormatHelper::Append(), clang::insights::GetNestedName(), kwTemplateSpace, mOutputFormatHelper, clang::insights::ScopeHandler::RemoveCurrentScope(), and clang::insights::ValueOrDefault().
Referenced by InsertQualifierAndNameWithTemplateArgs().
|
inlineprotected |
Definition at line 328 of file CodeGenerator.h.
References clang::insights::OutputFormatHelper::Append(), InsertQualifierAndName(), InsertTemplateArgs(), and mOutputFormatHelper.
|
inlineprotectedvirtual |
Reimplemented in clang::insights::CfrontCodeGenerator, and clang::insights::MultiStmtDeclCodeGenerator.
Definition at line 287 of file CodeGenerator.h.
|
protected |
Definition at line 4519 of file CodeGenerator.cpp.
|
protected |
Definition at line 3678 of file CodeGenerator.cpp.
References LAMBDA_SCOPE_HELPER, and RETURN_IF.
void clang::insights::CodeGenerator::InsertTemplateArg | ( | const TemplateArgument & | arg | ) |
Definition at line 4547 of file CodeGenerator.cpp.
References clang::insights::BuildTemplateParamObjectName(), clang::insights::EvaluateNTTPAsConstantExpr(), GetGlobalAST(), clang::insights::details::GetName(), and kwNullptr.
Referenced by clang::insights::CoroutinesCodeGenerator::InsertCoroutine(), InsertTemplateArgs(), and InsertTemplateParameters().
|
inlineprotected |
Definition at line 315 of file CodeGenerator.h.
References InsertTemplateArg().
Referenced by InsertTemplateArg().
|
inline |
Definition at line 255 of file CodeGenerator.h.
References clang::insights::OutputFormatHelper::Append(), ForEachArg(), clang::insights::OutputFormatHelper::GetString(), InsertTemplateArg(), and mOutputFormatHelper.
void clang::insights::CodeGenerator::InsertTemplateArgs | ( | const ClassTemplateSpecializationDecl & | clsTemplateSpe | ) |
Definition at line 4531 of file CodeGenerator.cpp.
|
inline |
Definition at line 218 of file CodeGenerator.h.
Referenced by clang::insights::GetDeclContext(), InsertFunctionNameWithReturnType(), InsertLambdaStaticInvoker(), InsertQualifierAndNameWithTemplateArgs(), and clang::insights::ScopeHandler::ScopeHandler().
|
protected |
Definition at line 1239 of file CodeGenerator.cpp.
Referenced by InsertTemplateParameters(), and InsertTemplateSpecializationHeader().
|
protected |
Definition at line 1217 of file CodeGenerator.cpp.
References clang::insights::OutputFormatHelper::AppendSemiNewLine(), GetGlobalAST(), clang::insights::GetName(), mOutputFormatHelper, and mSeenDecls.
|
protected |
Definition at line 1550 of file CodeGenerator.cpp.
References clang::insights::GetSM(), clang::insights::OutputFormatHelper::InsertIfDefTemplateGuard(), InsertInstantiationPoint(), and mOutputFormatHelper.
|
protected |
Definition at line 1559 of file CodeGenerator.cpp.
References clang::insights::OutputFormatHelper::InsertEndIfTemplateGuard(), and mOutputFormatHelper.
void clang::insights::CodeGenerator::InsertTemplateParameters | ( | const TemplateParameterList & | list, |
const TemplateParamsOnly | templateParamsOnly = TemplateParamsOnly::No |
||
) |
! Skip template, type constraints and class/typename.
Definition at line 1763 of file CodeGenerator.cpp.
References clang::insights::OutputFormatHelper::Append(), clang::insights::OutputFormatHelper::AppendComma(), clang::insights::OutputFormatHelper::AppendNewLine(), clang::insights::AppendTemplateTypeParamName(), clang::insights::Ellipsis(), clang::insights::EllipsisSpace(), clang::insights::EvaluateNTTPAsConstantExpr(), GetGlobalAST(), clang::insights::GetName(), clang::insights::GetTypeConstraintAsString(), clang::insights::GetTypeNameAsParameter(), hlpAssing, InsertArg(), InsertConceptConstraint(), InsertTemplateArg(), InsertTemplateArgsObjectParam(), kwClassSpace, kwElipsisSpace, kwTemplate, kwTemplateSpace, kwTypeNameSpace, mOutputFormatHelper, and clang::insights::ValueOr().
Referenced by clang::insights::GetDeclContext(), and InsertLambdaStaticInvoker().
|
protected |
Insert template<>
to introduce a template specialization.
Definition at line 1251 of file CodeGenerator.cpp.
References clang::insights::OutputFormatHelper::AppendNewLine(), InsertTemplateArgsObjectParam(), kwTemplate, and mOutputFormatHelper.
|
inlineprotectedvirtual |
Reimplemented in clang::insights::CoroutinesCodeGenerator, and clang::insights::MultiStmtDeclCodeGenerator.
Definition at line 284 of file CodeGenerator.h.
|
protected |
Definition at line 2108 of file CodeGenerator.cpp.
void clang::insights::CodeGenerator::LifetimeAddExtended | ( | const VarDecl * | vd, |
const ValueDecl * | extending | ||
) |
Definition at line 1177 of file CodeGenerator.cpp.
References clang::insights::LifetimeTracker::AddExtended(), and mLifeTimeTracker.
Referenced by clang::insights::TemporaryDeclFinder::VisitMaterializeTemporaryExpr().
|
protected |
Definition at line 3542 of file CodeGenerator.cpp.
References clang::insights::GetDeclContext().
|
inlineprotectedvirtual |
Show casts to xvalues independent from the show all casts option.
This helps showing xvalue casts in structured bindings.
Reimplemented in clang::insights::StructuredBindingsCodeGenerator.
Definition at line 293 of file CodeGenerator.h.
|
inlineprotectedvirtual |
Reimplemented in clang::insights::CoroutinesCodeGenerator.
Definition at line 285 of file CodeGenerator.h.
void clang::insights::CodeGenerator::StartLifetimeScope | ( | ) |
Definition at line 1183 of file CodeGenerator.cpp.
References mLifeTimeTracker, and clang::insights::LifetimeTracker::StartScope().
Referenced by clang::insights::TemporaryDeclFinder::VisitMaterializeTemporaryExpr().
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
! Signal whether we are processing a lambda created and assigned to an init capture of another lambda.
|
protected |
|
protected |
|
protected |
clang::insights::CodeGenerator::STRONG_BOOL | ( | TemplateParamsOnly | ) |
|
protected |
|
inlineprotected |
Definition at line 403 of file CodeGenerator.h.
References clang::insights::OutputFormatHelper::CurrentPos(), and mOutputFormatHelper.
|
protected |
Definition at line 5085 of file CodeGenerator.cpp.
|
protected |
Definition at line 5138 of file CodeGenerator.cpp.
Referenced by InsertCXXMethodHeader().
|
protected |
Definition at line 5150 of file CodeGenerator.cpp.
|
protected |
Definition at line 5120 of file CodeGenerator.cpp.
Referenced by clang::insights::CfrontCodeGenerator::InsertArg(), InsertCXXMethodHeader(), and InsertLambdaStaticInvoker().
|
protected |
Definition at line 5126 of file CodeGenerator.cpp.
|
protected |
Definition at line 5061 of file CodeGenerator.cpp.
Referenced by InsertCXXMethodHeader().
|
friend |
Definition at line 102 of file CodeGenerator.h.
|
staticconstexprprotected |
This is the upper limit of elements which will be shown for an array when filled by FillConstantArray
.
Definition at line 444 of file CodeGenerator.h.
Referenced by FillConstantArray().
|
protected |
The position in mOutputFormatHelper where a potential std::initializer_list expansion must be inserted.
Definition at line 449 of file CodeGenerator.h.
Referenced by InsertCXXMethodHeader().
|
protected |
The position in mOutputFormatHelper in a class where where a potential std::initializer_list expansion must be inserted.
Definition at line 453 of file CodeGenerator.h.
Referenced by InsertCXXMethodHeader().
|
protected |
The position in mOutputFormatHelper from a return where a potential std::initializer_list expansion must be inserted.
Definition at line 451 of file CodeGenerator.h.
|
protected |
The position in mOutputFormatHelper where a potential std::initializer_list expansion must be inserted.
Definition at line 447 of file CodeGenerator.h.
Referenced by InsertCXXMethodHeader().
|
protected |
Definition at line 443 of file CodeGenerator.h.
Referenced by HandleLambdaExpr().
|
protected |
Definition at line 436 of file CodeGenerator.h.
|
protected |
Definition at line 430 of file CodeGenerator.h.
Referenced by clang::insights::CfrontCodeGenerator::InsertArg().
|
protected |
Definition at line 429 of file CodeGenerator.h.
const Decl* clang::insights::CodeGenerator::mLastDecl {} |
Definition at line 98 of file CodeGenerator.h.
Referenced by clang::insights::CfrontCodeGenerator::InsertArg().
|
protected |
Definition at line 95 of file CodeGenerator.h.
Referenced by clang::insights::CfrontCodeGenerator::InsertArg().
|
protected |
Definition at line 94 of file CodeGenerator.h.
Referenced by clang::insights::CfrontCodeGenerator::InsertArg().
|
protected |
Definition at line 93 of file CodeGenerator.h.
Referenced by EndLifetimeScope(), InsertMethodBody(), LifetimeAddExtended(), and StartLifetimeScope().
|
protected |
At least in case if a requires-clause containing T{} we don't want to get T{{}}.
Definition at line 441 of file CodeGenerator.h.
|
protected |
Definition at line 104 of file CodeGenerator.h.
Referenced by EndLifetimeScope(), ForEachArg(), clang::insights::CfrontCodeGenerator::FormatCast(), clang::insights::CoroutinesCodeGenerator::InsertArg(), clang::insights::CfrontCodeGenerator::InsertArg(), clang::insights::CfrontCodeGenerator::InsertCXXMethodDecl(), InsertInstantiationPoint(), InsertLambdaStaticInvoker(), InsertMethodBody(), InsertNamespace(), InsertQualifierAndName(), InsertQualifierAndNameWithTemplateArgs(), InsertTemplateArgs(), InsertTemplateArgsObjectParam(), InsertTemplateGuardBegin(), InsertTemplateGuardEnd(), InsertTemplateParameters(), InsertTemplateSpecializationHeader(), UpdateCurrentPos(), and clang::insights::MultiStmtDeclCodeGenerator::~MultiStmtDeclCodeGenerator().
|
protected |
Helper output buffer for std::initializer_list expansion.
Definition at line 455 of file CodeGenerator.h.
Referenced by InsertCXXMethodHeader().
|
protected |
Definition at line 459 of file CodeGenerator.h.
Referenced by InsertMethodBody().
|
protected |
Definition at line 101 of file CodeGenerator.h.
|
protected |
Track whether this is a function with an imlpicit return 0.
Definition at line 457 of file CodeGenerator.h.
Referenced by InsertMethodBody().
|
inlinestaticprotected |
Definition at line 460 of file CodeGenerator.h.
Referenced by InsertTemplateArgsObjectParam().
|
protected |
Definition at line 438 of file CodeGenerator.h.
|
protected |
Definition at line 458 of file CodeGenerator.h.
Referenced by EndLifetimeScope().
|
protected |
Definition at line 439 of file CodeGenerator.h.
|
protected |
Definition at line 440 of file CodeGenerator.h.