clang: lib/CodeGen/CGCleanup.cpp File Reference (original) (raw)
#include "[CGCleanup.h](CGCleanup%5F8h%5Fsource.html)"#include "[CodeGenFunction.h](CodeGenFunction%5F8h%5Fsource.html)"#include "llvm/Support/SaveAndRestore.h"
Go to the source code of this file.
| Enumerations | |
|---|---|
| enum | ForActivation_t { ForActivation, ForDeactivation } |
| Functions | |
|---|---|
| static void | createStoreInstBefore (llvm::Value *value, Address addr, llvm::BasicBlock::iterator beforeInst, CodeGenFunction &CGF) |
| static llvm::LoadInst * | createLoadInstBefore (Address addr, const Twine &name, llvm::BasicBlock::iterator beforeInst, CodeGenFunction &CGF) |
| static llvm::LoadInst * | createLoadInstBefore (Address addr, const Twine &name, CodeGenFunction &CGF) |
| static void | ResolveAllBranchFixups (CodeGenFunction &CGF, llvm::SwitchInst *Switch, llvm::BasicBlock *CleanupEntry) |
| All the branch fixups on the EH stack have propagated out past the outermost normal cleanup; resolve them all by adding cases to the given switch instruction. | |
| static llvm::SwitchInst * | TransitionToCleanupSwitch (CodeGenFunction &CGF, llvm::BasicBlock *Block) |
| Transitions the terminator of the given exit-block of a cleanup to be a cleanup switch. | |
| static llvm::BasicBlock * | CreateNormalEntry (CodeGenFunction &CGF, EHCleanupScope &Scope) |
| static llvm::BasicBlock * | SimplifyCleanupEntry (CodeGenFunction &CGF, llvm::BasicBlock *Entry) |
| Attempts to reduce a cleanup's entry block to a fallthrough. | |
| static void | EmitCleanup (CodeGenFunction &CGF, EHScopeStack::Cleanup *Fn, EHScopeStack::Cleanup::Flags flags, Address ActiveFlag) |
| static void | ForwardPrebranchedFallthrough (llvm::BasicBlock *Exit, llvm::BasicBlock *From, llvm::BasicBlock *To) |
| static void | destroyOptimisticNormalEntry (CodeGenFunction &CGF, EHCleanupScope &scope) |
| We don't need a normal entry block for the given cleanup. | |
| static bool | IsUsedAsEHCleanup (EHScopeStack &EHStack, EHScopeStack::stable_iterator cleanup) |
| static void | SetupCleanupBlockActivation (CodeGenFunction &CGF, EHScopeStack::stable_iterator C, ForActivation_t kind, llvm::Instruction *dominatingIP) |
| The given cleanup block is changing activation state. | |
| static void | EmitSehScope (CodeGenFunction &CGF, llvm::FunctionCallee &SehCppScope) |
◆ ForActivation_t
| Enumerator |
|---|
| ForActivation |
| ForDeactivation |
Definition at line 1211 of file CGCleanup.cpp.
◆ createLoadInstBefore() [1/2]
◆ createLoadInstBefore() [2/2]
| llvm::LoadInst * createLoadInstBefore ( Address addr, const Twine & name, llvm::BasicBlock::iterator beforeInst, CodeGenFunction & CGF ) | static |
|---|
◆ CreateNormalEntry()
◆ createStoreInstBefore()
◆ destroyOptimisticNormalEntry()
◆ EmitCleanup()
| void EmitCleanup ( CodeGenFunction & CGF, EHScopeStack::Cleanup * Fn, EHScopeStack::Cleanup::Flags flags, Address ActiveFlag ) | static |
|---|
◆ EmitSehScope()
| void EmitSehScope ( CodeGenFunction & CGF, llvm::FunctionCallee & SehCppScope ) | static |
|---|
◆ ForwardPrebranchedFallthrough()
| void ForwardPrebranchedFallthrough ( llvm::BasicBlock * Exit, llvm::BasicBlock * From, llvm::BasicBlock * To ) | static |
|---|
◆ IsUsedAsEHCleanup()
| bool IsUsedAsEHCleanup ( EHScopeStack & EHStack, EHScopeStack::stable_iterator cleanup ) | static |
|---|
◆ ResolveAllBranchFixups()
| void ResolveAllBranchFixups ( CodeGenFunction & CGF, llvm::SwitchInst * Switch, llvm::BasicBlock * CleanupEntry ) | static |
|---|
All the branch fixups on the EH stack have propagated out past the outermost normal cleanup; resolve them all by adding cases to the given switch instruction.
Definition at line 327 of file CGCleanup.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::EHScopeStack::clearFixups(), createStoreInstBefore(), clang::CodeGen::BranchFixup::Destination, clang::CodeGen::BranchFixup::DestinationIndex, clang::CodeGen::CodeGenFunction::EHStack, clang::CodeGen::EHScopeStack::getBranchFixup(), clang::CodeGen::CodeGenFunction::getNormalCleanupDestSlot(), clang::CodeGen::EHScopeStack::getNumBranchFixups(), clang::CodeGen::BranchFixup::InitialBranch, clang::CodeGen::BranchFixup::OptimisticBranchBlock, and clang::Switch.
Referenced by clang::CodeGen::CodeGenFunction::PopCleanupBlock().
◆ SetupCleanupBlockActivation()
| void SetupCleanupBlockActivation ( CodeGenFunction & CGF, EHScopeStack::stable_iterator C, ForActivation_t kind, llvm::Instruction * dominatingIP ) | static |
|---|
The given cleanup block is changing activation state.
Configure a cleanup variable if necessary.
It would be good if we had some way of determining if there were extra uses after the change-over point.
Definition at line 1221 of file CGCleanup.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::C, clang::cast(), clang::CodeGen::CGBuilderTy::CreateStore(), createStoreInstBefore(), clang::CodeGen::CodeGenFunction::CreateTempAlloca(), clang::CodeGen::CodeGenFunction::EHStack, clang::CodeGen::EHScopeStack::find(), ForActivation, ForDeactivation, clang::CodeGen::CodeGenFunction::isInConditionalBranch(), IsUsedAsEHCleanup(), clang::CharUnits::One(), clang::CodeGen::CodeGenFunction::setBeforeOutermostConditional(), and clang::CodeGen::CodeGenFunction::AllocaTrackerRAII::Take().
Referenced by clang::CodeGen::CodeGenFunction::ActivateCleanupBlock(), and clang::CodeGen::CodeGenFunction::DeactivateCleanupBlock().
◆ SimplifyCleanupEntry()
| llvm::BasicBlock * SimplifyCleanupEntry ( CodeGenFunction & CGF, llvm::BasicBlock * Entry ) | static |
|---|
◆ TransitionToCleanupSwitch()
| llvm::SwitchInst * TransitionToCleanupSwitch ( CodeGenFunction & CGF, llvm::BasicBlock * Block ) | static |
|---|