Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
QV4::Compiler::ControlFlow Struct Reference

#include <qv4compilercontrolflow_p.h>

+ Inheritance diagram for QV4::Compiler::ControlFlow:
+ Collaboration diagram for QV4::Compiler::ControlFlow:

Classes

struct  UnwindTarget
 

Public Types

enum  Type {
  Loop , With , Block , Finally ,
  Catch
}
 
enum  UnwindType { Break , Continue , Return }
 
using Reference = Codegen::Reference
 
using BytecodeGenerator = Moth::BytecodeGenerator
 
using Instruction = Moth::Instruction
 

Public Member Functions

 ControlFlow (Codegen *cg, Type type)
 
virtual ~ControlFlow ()
 
UnwindTarget unwindTarget (UnwindType type, const QString &label=QString())
 
virtual QString label () const
 
bool hasLoop () const
 
BytecodeGenerator::ExceptionHandlerparentUnwindHandler ()
 
virtual BytecodeGenerator::ExceptionHandlerunwindHandler ()
 

Public Attributes

Codegencg
 
ControlFlowparent
 
Type type
 

Protected Member Functions

virtual BytecodeGenerator::Label getUnwindTarget (UnwindType, const QString &=QString())
 
virtual bool requiresUnwind ()
 
QString loopLabel () const
 
BytecodeGeneratorgenerator () const
 

Detailed Description

Definition at line 27 of file qv4compilercontrolflow_p.h.

Member Typedef Documentation

◆ BytecodeGenerator

◆ Instruction

◆ Reference

Member Enumeration Documentation

◆ Type

Enumerator
Loop 
With 
Block 
Finally 
Catch 

Definition at line 32 of file qv4compilercontrolflow_p.h.

◆ UnwindType

Enumerator
Break 
Continue 
Return 

Definition at line 40 of file qv4compilercontrolflow_p.h.

Constructor & Destructor Documentation

◆ ControlFlow()

QV4::Compiler::ControlFlow::ControlFlow ( Codegen * cg,
Type type )
inline

Definition at line 55 of file qv4compilercontrolflow_p.h.

References cg, and QV4::Compiler::Codegen::controlFlow.

◆ ~ControlFlow()

virtual QV4::Compiler::ControlFlow::~ControlFlow ( )
inlinevirtual

Definition at line 61 of file qv4compilercontrolflow_p.h.

References cg, QV4::Compiler::Codegen::controlFlow, and parent.

Member Function Documentation

◆ generator()

◆ getUnwindTarget()

virtual BytecodeGenerator::Label QV4::Compiler::ControlFlow::getUnwindTarget ( UnwindType ,
const QString & = QString() )
inlineprotectedvirtual

Reimplemented in QV4::Compiler::ControlFlowLoop.

Definition at line 96 of file qv4compilercontrolflow_p.h.

References QV4::Moth::BytecodeGenerator::Label.

Referenced by unwindTarget().

+ Here is the caller graph for this function:

◆ hasLoop()

bool QV4::Compiler::ControlFlow::hasLoop ( ) const
inline

Definition at line 85 of file qv4compilercontrolflow_p.h.

References Loop, parent, and type.

Referenced by QV4::Compiler::Codegen::statementList().

+ Here is the caller graph for this function:

◆ label()

virtual QString QV4::Compiler::ControlFlow::label ( ) const
inlinevirtual

Reimplemented in QV4::Compiler::ControlFlowLoop.

Definition at line 83 of file qv4compilercontrolflow_p.h.

Referenced by loopLabel(), and QV4::Compiler::Codegen::visit().

+ Here is the caller graph for this function:

◆ loopLabel()

QString QV4::Compiler::ControlFlow::loopLabel ( ) const
inlineprotected

Definition at line 114 of file qv4compilercontrolflow_p.h.

References QV4::Compiler::Codegen::_labelledStatement, cg, label(), QQmlJS::AST::LabelledStatement::label, and QStringView::toString().

+ Here is the call graph for this function:

◆ parentUnwindHandler()

BytecodeGenerator::ExceptionHandler * QV4::Compiler::ControlFlow::parentUnwindHandler ( )
inline

Definition at line 104 of file qv4compilercontrolflow_p.h.

References parent, and unwindHandler().

Referenced by QV4::Compiler::ControlFlowBlock::~ControlFlowBlock(), QV4::Compiler::ControlFlowCatch::~ControlFlowCatch(), QV4::Compiler::ControlFlowFinally::~ControlFlowFinally(), QV4::Compiler::ControlFlowUnwindCleanup::~ControlFlowUnwindCleanup(), QV4::Compiler::ControlFlowWith::~ControlFlowWith(), unwindHandler(), QV4::Compiler::ControlFlowUnwind::unwindHandler(), and QV4::Compiler::ControlFlowFinally::unwindHandler().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ requiresUnwind()

virtual bool QV4::Compiler::ControlFlow::requiresUnwind ( )
inlineprotectedvirtual

Reimplemented in QV4::Compiler::ControlFlowUnwindCleanup, QV4::Compiler::ControlFlowWith, QV4::Compiler::ControlFlowBlock, QV4::Compiler::ControlFlowCatch, and QV4::Compiler::ControlFlowFinally.

Definition at line 99 of file qv4compilercontrolflow_p.h.

Referenced by QV4::Compiler::ControlFlowUnwind::emitUnwindHandler(), and unwindTarget().

+ Here is the caller graph for this function:

◆ unwindHandler()

virtual BytecodeGenerator::ExceptionHandler * QV4::Compiler::ControlFlow::unwindHandler ( )
inlinevirtual

Reimplemented in QV4::Compiler::ControlFlowUnwind, QV4::Compiler::ControlFlowCatch, and QV4::Compiler::ControlFlowFinally.

Definition at line 108 of file qv4compilercontrolflow_p.h.

References parentUnwindHandler().

Referenced by parentUnwindHandler().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ unwindTarget()

UnwindTarget QV4::Compiler::ControlFlow::unwindTarget ( UnwindType type,
const QString & label = QString() )
inline

Definition at line 65 of file qv4compilercontrolflow_p.h.

References Break, cg, Continue, getUnwindTarget(), QV4::Moth::BytecodeGenerator::Label::isValid(), parent, Q_ASSERT, requiresUnwind(), Return, and QV4::Compiler::Codegen::returnLabel().

Referenced by QV4::Compiler::Codegen::emitReturn(), QV4::Compiler::Codegen::visit(), and QV4::Compiler::Codegen::visit().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Member Data Documentation

◆ cg

◆ parent

ControlFlow* QV4::Compiler::ControlFlow::parent

◆ type

Type QV4::Compiler::ControlFlow::type

Definition at line 53 of file qv4compilercontrolflow_p.h.

Referenced by hasLoop().


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