clang 23.0.0git
clang::CIRGen::CIRGenFunction::LexicalScope Struct Reference

Represents a scope, including function bodies, compound statements, and the substatements of if/while/do/for/switch/try statements. More...

#include "/work/as-worker-4/publish-doxygen-docs/llvm-project/clang/lib/CIR/CodeGen/CIRGenFunction.h"

Inheritance diagram for clang::CIRGen::CIRGenFunction::LexicalScope:
[legend]

Public Member Functions

 LexicalScope (CIRGenFunction &cgf, mlir::Location loc, mlir::Block *eb)
void setRetVal (mlir::Value v)
void cleanup ()
void restore ()
 ~LexicalScope ()
bool hasCoreturn () const
void setCoreturn ()
bool isGlobalInit ()
bool isRegular ()
bool isSwitch ()
bool isTernary ()
bool isTry ()
cir::TryOp getClosestTryParent ()
void setAsGlobalInit ()
void setAsSwitch ()
void setAsTernary ()
void setAsTry (cir::TryOp op)
mlir::Block * getOrCreateCleanupBlock (mlir::OpBuilder &builder)
cir::TryOp getTry ()
mlir::Block * getCleanupBlock (mlir::OpBuilder &builder)
mlir::Block * createCleanupBlock (mlir::OpBuilder &builder)
llvm::ArrayRef< mlir::Block * > getRetBlocks ()
mlir::Location getRetLoc (mlir::Block *b)
void updateRetLoc (mlir::Block *b, mlir::Location loc)
mlir::Block * getOrCreateRetBlock (CIRGenFunction &cgf, mlir::Location loc)
mlir::Block * getEntryBlock ()
Public Member Functions inherited from clang::CIRGen::CIRGenFunction::RunCleanupsScope
 RunCleanupsScope (CIRGenFunction &cgf)
 Enter a new cleanup scope.
 ~RunCleanupsScope ()
 Exit this cleanup scope, emitting any accumulated cleanups.
void forceCleanup (ArrayRef< mlir::Value * > valuesToReload={})
 Force the emission of cleanups now, instead of waiting until this object is destroyed.
bool hasPendingCleanups () const
 Whether there are any pending cleanups that have been pushed since this scope was entered.

Public Attributes

unsigned depth = 0

Additional Inherited Members

Protected Attributes inherited from clang::CIRGen::CIRGenFunction::RunCleanupsScope
bool performCleanup
bool oldDidCallStackSave
CIRGenFunctioncgf

Detailed Description

Represents a scope, including function bodies, compound statements, and the substatements of if/while/do/for/switch/try statements.

This class handles any automatic cleanup, along with the return value.

Definition at line 1055 of file CIRGenFunction.h.

Constructor & Destructor Documentation

◆ LexicalScope()

clang::CIRGen::CIRGenFunction::LexicalScope::LexicalScope ( CIRGenFunction & cgf,
mlir::Location loc,
mlir::Block * eb )
inline

◆ ~LexicalScope()

clang::CIRGen::CIRGenFunction::LexicalScope::~LexicalScope ( )
inline

Member Function Documentation

◆ cleanup()

◆ createCleanupBlock()

mlir::Block * clang::CIRGen::CIRGenFunction::LexicalScope::createCleanupBlock ( mlir::OpBuilder & builder)
inline

◆ getCleanupBlock()

mlir::Block * clang::CIRGen::CIRGenFunction::LexicalScope::getCleanupBlock ( mlir::OpBuilder & builder)
inline

Definition at line 1160 of file CIRGenFunction.h.

Referenced by cleanup().

◆ getClosestTryParent()

cir::TryOp clang::CIRGen::CIRGenFunction::LexicalScope::getClosestTryParent ( )

Definition at line 465 of file CIRGenFunction.cpp.

References getTry(), isTry(), and LexicalScope().

◆ getEntryBlock()

mlir::Block * clang::CIRGen::CIRGenFunction::LexicalScope::getEntryBlock ( )
inline

Definition at line 1243 of file CIRGenFunction.h.

Referenced by emitSuspendExpr().

◆ getOrCreateCleanupBlock()

mlir::Block * clang::CIRGen::CIRGenFunction::LexicalScope::getOrCreateCleanupBlock ( mlir::OpBuilder & builder)
inline

Definition at line 1148 of file CIRGenFunction.h.

References createCleanupBlock().

Referenced by createNormalEntry().

◆ getOrCreateRetBlock()

mlir::Block * clang::CIRGen::CIRGenFunction::LexicalScope::getOrCreateRetBlock ( CIRGenFunction & cgf,
mlir::Location loc )
inline

◆ getRetBlocks()

llvm::ArrayRef< mlir::Block * > clang::CIRGen::CIRGenFunction::LexicalScope::getRetBlocks ( )
inline

Definition at line 1209 of file CIRGenFunction.h.

Referenced by cleanup().

◆ getRetLoc()

mlir::Location clang::CIRGen::CIRGenFunction::LexicalScope::getRetLoc ( mlir::Block * b)
inline

Definition at line 1210 of file CIRGenFunction.h.

References b.

Referenced by cleanup().

◆ getTry()

cir::TryOp clang::CIRGen::CIRGenFunction::LexicalScope::getTry ( )
inline

Definition at line 1155 of file CIRGenFunction.h.

References isTry().

Referenced by getClosestTryParent().

◆ hasCoreturn()

bool clang::CIRGen::CIRGenFunction::LexicalScope::hasCoreturn ( ) const
inline

Definition at line 1127 of file CIRGenFunction.h.

Referenced by emitBodyAndFallthrough().

◆ isGlobalInit()

bool clang::CIRGen::CIRGenFunction::LexicalScope::isGlobalInit ( )
inline

Definition at line 1133 of file CIRGenFunction.h.

Referenced by cleanup().

◆ isRegular()

bool clang::CIRGen::CIRGenFunction::LexicalScope::isRegular ( )
inline

Definition at line 1134 of file CIRGenFunction.h.

◆ isSwitch()

bool clang::CIRGen::CIRGenFunction::LexicalScope::isSwitch ( )
inline

Definition at line 1135 of file CIRGenFunction.h.

◆ isTernary()

bool clang::CIRGen::CIRGenFunction::LexicalScope::isTernary ( )
inline

Definition at line 1136 of file CIRGenFunction.h.

Referenced by cleanup().

◆ isTry()

bool clang::CIRGen::CIRGenFunction::LexicalScope::isTry ( )
inline

Definition at line 1137 of file CIRGenFunction.h.

Referenced by getClosestTryParent(), and getTry().

◆ restore()

void clang::CIRGen::CIRGenFunction::LexicalScope::restore ( )
inline

Definition at line 1116 of file CIRGenFunction.h.

References clang::CIRGen::CIRGenFunction::RunCleanupsScope::cgf.

Referenced by ~LexicalScope().

◆ setAsGlobalInit()

void clang::CIRGen::CIRGenFunction::LexicalScope::setAsGlobalInit ( )
inline

◆ setAsSwitch()

void clang::CIRGen::CIRGenFunction::LexicalScope::setAsSwitch ( )
inline

Definition at line 1140 of file CIRGenFunction.h.

◆ setAsTernary()

void clang::CIRGen::CIRGenFunction::LexicalScope::setAsTernary ( )
inline

Definition at line 1141 of file CIRGenFunction.h.

◆ setAsTry()

void clang::CIRGen::CIRGenFunction::LexicalScope::setAsTry ( cir::TryOp op)
inline

Definition at line 1142 of file CIRGenFunction.h.

◆ setCoreturn()

void clang::CIRGen::CIRGenFunction::LexicalScope::setCoreturn ( )
inline

Definition at line 1128 of file CIRGenFunction.h.

◆ setRetVal()

void clang::CIRGen::CIRGenFunction::LexicalScope::setRetVal ( mlir::Value v)
inline

Definition at line 1113 of file CIRGenFunction.h.

◆ updateRetLoc()

void clang::CIRGen::CIRGenFunction::LexicalScope::updateRetLoc ( mlir::Block * b,
mlir::Location loc )
inline

Definition at line 1211 of file CIRGenFunction.h.

References b.

Referenced by getOrCreateRetBlock().

Member Data Documentation

◆ depth

unsigned clang::CIRGen::CIRGenFunction::LexicalScope::depth = 0

Definition at line 1095 of file CIRGenFunction.h.

Referenced by cleanup(), and LexicalScope().


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