Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
clang::insights::MultiStmtDeclCodeGenerator Class Referencefinal

#include "CodeGenerator.h"

Inheritance diagram for clang::insights::MultiStmtDeclCodeGenerator:
Inheritance graph
[legend]
Collaboration diagram for clang::insights::MultiStmtDeclCodeGenerator:
Collaboration graph
[legend]

Public Member Functions

 MultiStmtDeclCodeGenerator (OutputFormatHelper &_outputFormatHelper, LambdaStackType &lambdaStack, bool insertVarDecl)
 
 ~MultiStmtDeclCodeGenerator ()
 
virtual void InsertArg (const Decl *stmt)
 
virtual void InsertArg (const Stmt *stmt)
 
- Public Member Functions inherited from clang::insights::CodeGenerator
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 ()
 

Protected Member Functions

bool InsertVarDecl (const VarDecl *) override
 
bool InsertComma () override
 
bool InsertSemi () override
 
- Protected Member Functions inherited from clang::insights::CodeGenerator
 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 SkipSpaceAfterVarDecl ()
 
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 &param)
 
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)
 

Protected Attributes

OnceTrue mInsertVarDecl {}
 
OnceFalse mInsertComma {}
 Insert the VarDecl only once. More...
 
- Protected Attributes inherited from clang::insights::CodeGenerator
LifetimeTracker mLifeTimeTracker {}
 
const StmtmLastStmt {}
 
const Expr * mLastExpr {}
 
bool mProcessingVarDecl {}
 
OutputFormatHelpermOutputFormatHelper
 
LambdaStackType mLambdaStackThis
 
LambdaStackTypemLambdaStack
 
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 {}
 
OutputFormatHelpermOutputFormatHelperOutside
 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 {}
 

Additional Inherited Members

- Public Attributes inherited from clang::insights::CodeGenerator
const Decl * mLastDecl {}
 
- Protected Types inherited from clang::insights::CodeGenerator
enum class  LambdaCallerType {
  VarDecl , InitCapture , CallExpr , OperatorCallExpr ,
  MemberCallExpr , LambdaExpr , ReturnStmt , BinaryOperator ,
  CXXMethodDecl , TemplateHead , Decltype
}
 
enum class  BraceKind { Parens , Curlys }
 
using LambdaStackType = StackList< class LambdaHelper >
 
- Static Protected Member Functions inherited from clang::insights::CodeGenerator
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)
 
- Static Protected Attributes inherited from clang::insights::CodeGenerator
static constexpr auto MAX_FILL_VALUES_FOR_ARRAYS
 
static std::map< std::string, bool > mSeenDecls {}
 

Detailed Description

Definition at line 485 of file CodeGenerator.h.

Constructor & Destructor Documentation

◆ MultiStmtDeclCodeGenerator()

clang::insights::MultiStmtDeclCodeGenerator::MultiStmtDeclCodeGenerator ( OutputFormatHelper _outputFormatHelper,
LambdaStackType lambdaStack,
bool  insertVarDecl 
)
inlineexplicit

Definition at line 488 of file CodeGenerator.h.

◆ ~MultiStmtDeclCodeGenerator()

clang::insights::MultiStmtDeclCodeGenerator::~MultiStmtDeclCodeGenerator ( )
inline

Member Function Documentation

◆ InsertArg() [1/2]

void clang::insights::CodeGenerator::InsertArg

Definition at line 214 of file CodeGenerator.cpp.

◆ InsertArg() [2/2]

void clang::insights::CodeGenerator::InsertArg

Definition at line 215 of file CodeGenerator.cpp.

◆ InsertComma()

bool clang::insights::MultiStmtDeclCodeGenerator::InsertComma ( )
inlineoverrideprotectedvirtual

Reimplemented from clang::insights::CodeGenerator.

Definition at line 508 of file CodeGenerator.h.

References mInsertComma.

◆ InsertSemi()

bool clang::insights::MultiStmtDeclCodeGenerator::InsertSemi ( )
inlineoverrideprotectedvirtual

Reimplemented from clang::insights::CodeGenerator.

Definition at line 509 of file CodeGenerator.h.

◆ InsertVarDecl()

bool clang::insights::MultiStmtDeclCodeGenerator::InsertVarDecl ( const VarDecl *  )
inlineoverrideprotectedvirtual

Insert the comma after we have generated the first VarDecl and we are about to insert another one.

Reimplemented from clang::insights::CodeGenerator.

Definition at line 507 of file CodeGenerator.h.

References mInsertVarDecl.

Member Data Documentation

◆ mInsertComma

OnceFalse clang::insights::MultiStmtDeclCodeGenerator::mInsertComma {}
protected

Insert the VarDecl only once.

Definition at line 504 of file CodeGenerator.h.

Referenced by InsertComma().

◆ mInsertVarDecl

OnceTrue clang::insights::MultiStmtDeclCodeGenerator::mInsertVarDecl {}
protected

Definition at line 503 of file CodeGenerator.h.

Referenced by InsertVarDecl().


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