14#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYEXCEPTIONINFO_H
15#define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYEXCEPTIONINFO_H
23class MachineDominatorTree;
24class MachineDominanceFrontier;
46 std::vector<std::unique_ptr<WebAssemblyException>> SubExceptions;
47 std::vector<MachineBasicBlock *> Blocks;
89 const std::vector<std::unique_ptr<WebAssemblyException>> &
97 SubExceptions.push_back(std::move(
E));
112 CurException; CurException = CurException->ParentException)
126 std::vector<std::unique_ptr<WebAssemblyException>> TopLevelExceptions;
149 bool empty()
const {
return TopLevelExceptions.empty(); }
154 return BBMap.lookup(
MBB);
167 assert(!WE->getParentException() &&
"Not a top level exception!");
168 TopLevelExceptions.push_back(std::move(WE));
BlockVerifier::State From
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
DenseMap< Block *, BlockRelaxAux > Blocks
assert(ImpDefSCC.getReg()==AMDGPU::SCC &&ImpDefSCC.isDef())
This file defines the SmallPtrSet class.
This file contains the entry points for global functions defined in the LLVM WebAssembly back-end.
Represent the analysis usage information of a pass.
ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
MachineFunctionPass - This class adapts the FunctionPass interface to allow convenient creation of pa...
A Module instance is used to store all the information related to an LLVM module.
static PassRegistry * getPassRegistry()
getPassRegistry - Access the global registry object, which is automatically initialized at applicatio...
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
bool erase(PtrType Ptr)
Remove pointer from the set.
size_type count(ConstPtrType Ptr) const
count - Return 1 if the specified pointer is in the set, 0 otherwise.
std::pair< iterator, bool > insert(PtrType Ptr)
Inserts Ptr if and only if there is no element in the container equal to Ptr.
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
WebAssemblyExceptionInfo()
~WebAssemblyExceptionInfo() override
void changeExceptionFor(const MachineBasicBlock *MBB, WebAssemblyException *WE)
bool runOnMachineFunction(MachineFunction &) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
void addTopLevelException(std::unique_ptr< WebAssemblyException > WE)
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
void recalculate(MachineFunction &MF, MachineDominatorTree &MDT, const MachineDominanceFrontier &MDF)
WebAssemblyException * getExceptionFor(const MachineBasicBlock *MBB) const
void print(raw_ostream &OS, const Module *M=nullptr) const override
print - Print out the internal state of the pass.
WebAssemblyExceptionInfo & operator=(const WebAssemblyExceptionInfo &)=delete
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
WebAssemblyExceptionInfo(const WebAssemblyExceptionInfo &)=delete
void reverseBlock(unsigned From=0)
block_iterator block_end() const
void print(raw_ostream &OS, unsigned Depth=0) const
bool contains(const WebAssemblyException *WE) const
WebAssemblyException(const WebAssemblyException &)=delete
unsigned getNumBlocks() const
MachineBasicBlock * getEHPad() const
void addToBlocksSet(MachineBasicBlock *MBB)
bool contains(const MachineBasicBlock *MBB) const
iterator_range< block_iterator > blocks() const
void reserveBlocks(unsigned Size)
const std::vector< std::unique_ptr< WebAssemblyException > > & getSubExceptions() const
SmallPtrSetImpl< MachineBasicBlock * > & getBlocksSet()
block_iterator block_begin() const
std::vector< std::unique_ptr< WebAssemblyException > > & getSubExceptions()
typename ArrayRef< MachineBasicBlock * >::const_iterator block_iterator
void addSubException(std::unique_ptr< WebAssemblyException > E)
ArrayRef< MachineBasicBlock * > getBlocks() const
std::vector< MachineBasicBlock * > & getBlocksVector()
WebAssemblyException * getParentException() const
void removeFromBlocksSet(MachineBasicBlock *MBB)
WebAssemblyException(MachineBasicBlock *EHPad)
void addBlock(MachineBasicBlock *MBB)
unsigned getExceptionDepth() const
MachineBasicBlock * getHeader() const
void setParentException(WebAssemblyException *WE)
typename decltype(SubExceptions)::const_iterator iterator
void addToBlocksVector(MachineBasicBlock *MBB)
const WebAssemblyException & operator=(const WebAssemblyException &)=delete
A range adaptor for a pair of iterators.
This class implements an extremely fast bulk output stream that can only output to a stream.
This is an optimization pass for GlobalISel generic memory operations.
iterator_range< T > make_range(T x, T y)
Convenience function for iterating over sub-ranges.
void initializeWebAssemblyExceptionInfoPass(PassRegistry &)
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)