clang
9.0.0
|
Go to the source code of this file.
Enumerations | |
enum | ForActivation_t { ForActivation, ForDeactivation } |
Functions | |
static void | createStoreInstBefore (llvm::Value *value, Address addr, llvm::Instruction *beforeInst) |
static llvm::LoadInst * | createLoadInstBefore (Address addr, const Twine &name, llvm::Instruction *beforeInst) |
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. More... | |
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. More... | |
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. More... | |
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. More... | |
static bool | IsUsedAsNormalCleanup (EHScopeStack &EHStack, EHScopeStack::stable_iterator C) |
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. More... | |
enum ForActivation_t |
Enumerator | |
---|---|
ForActivation | |
ForDeactivation |
Definition at line 1159 of file CGCleanup.cpp.
|
static |
Definition at line 310 of file CGCleanup.cpp.
References clang::CodeGen::Address::getAlignment(), clang::CodeGen::Address::getPointer(), clang::CharUnits::getQuantity(), and clang::tooling::name().
Referenced by TransitionToCleanupSwitch().
|
static |
|
static |
Definition at line 304 of file CGCleanup.cpp.
References clang::CodeGen::Address::getAlignment(), clang::CodeGen::Address::getPointer(), and clang::CharUnits::getQuantity().
Referenced by ResolveAllBranchFixups(), and SetupCleanupBlockActivation().
|
static |
We don't need a normal entry block for the given cleanup.
Optimistic fixup branches can cause these blocks to come into existence anyway; if so, destroy it.
The validity of this transformation is very much specific to the exact ways in which we form branches to cleanup entries.
Definition at line 604 of file CGCleanup.cpp.
References clang::Create(), clang::CodeGen::EHCleanupScope::getNormalBlock(), clang::CodeGen::Address::getPointer(), clang::CodeGen::CodeGenFunction::getUnreachableBlock(), i, and clang::CodeGen::CodeGenFunction::NormalCleanupDest.
|
static |
Definition at line 555 of file CGCleanup.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CodeGenFunction::createBasicBlock(), clang::CodeGen::CGBuilderTy::CreateLoad(), clang::CodeGen::EHScopeStack::Cleanup::Emit(), clang::CodeGen::CodeGenFunction::EmitBlock(), clang::CodeGen::CodeGenFunction::HaveInsertPoint(), and clang::CodeGen::Address::isValid().
|
static |
Definition at line 580 of file CGCleanup.cpp.
|
static |
Definition at line 1138 of file CGCleanup.cpp.
References clang::format::cleanup(), clang::CodeGen::EHScopeStack::find(), clang::CodeGen::EHScopeStack::getInnermostEHScope(), clang::CodeGen::EHScope::hasEHBranches(), i, and clang::CodeGen::EHScopeStack::stable_iterator::strictlyEncloses().
Referenced by SetupCleanupBlockActivation().
|
static |
Definition at line 1119 of file CGCleanup.cpp.
References clang::CodeGen::EHScopeStack::find(), clang::CodeGen::EHScopeStack::getInnermostNormalCleanup(), and clang::CodeGen::EHScopeStack::stable_iterator::strictlyEncloses().
Referenced by SetupCleanupBlockActivation().
|
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 320 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, and clang::CodeGen::BranchFixup::OptimisticBranchBlock.
|
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 1169 of file CGCleanup.cpp.
References clang::CodeGen::CodeGenFunction::Builder, clang::CodeGen::CGBuilderTy::CreateStore(), createStoreInstBefore(), clang::CodeGen::CodeGenFunction::CreateTempAlloca(), clang::CodeGen::CodeGenFunction::EHStack, clang::CodeGen::EHScopeStack::find(), ForActivation, ForDeactivation, clang::CodeGen::EHCleanupScope::getActiveFlag(), clang::CodeGen::EHCleanupScope::isEHCleanup(), clang::CodeGen::CodeGenFunction::isInConditionalBranch(), clang::CodeGen::EHCleanupScope::isNormalCleanup(), IsUsedAsEHCleanup(), IsUsedAsNormalCleanup(), clang::CodeGen::Address::isValid(), clang::CharUnits::One(), clang::CodeGen::EHCleanupScope::setActiveFlag(), clang::CodeGen::CodeGenFunction::setBeforeOutermostConditional(), clang::CodeGen::EHCleanupScope::setTestFlagInEHCleanup(), and clang::CodeGen::EHCleanupScope::setTestFlagInNormalCleanup().
Referenced by clang::CodeGen::CodeGenFunction::ActivateCleanupBlock().
|
static |
Attempts to reduce a cleanup's entry block to a fallthrough.
This is basically llvm::MergeBlockIntoPredecessor, except simplified/optimized for the tighter constraints on cleanup blocks.
Returns the new block, whatever it is.
Definition at line 521 of file CGCleanup.cpp.
References clang::CodeGen::CodeGenFunction::Builder.
|
static |
Transitions the terminator of the given exit-block of a cleanup to be a cleanup switch.
Definition at line 358 of file CGCleanup.cpp.
References clang::Create(), createLoadInstBefore(), and clang::CodeGen::CodeGenFunction::getNormalCleanupDestSlot().
Referenced by clang::CodeGen::CodeGenFunction::ResolveBranchFixups().