14#ifndef LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYEXCEPTIONINFO_H
15#define LLVM_LIB_TARGET_WEBASSEMBLY_WEBASSEMBLYEXCEPTIONINFO_H
50 std::vector<std::unique_ptr<WebAssemblyException>> SubExceptions;
51 std::vector<MachineBasicBlock *> Blocks;
72 return BlockSet.count(
MBB);
79 Blocks.push_back(
MBB);
93 const std::vector<std::unique_ptr<WebAssemblyException>> &
101 SubExceptions.push_back(std::move(
E));
109 std::reverse(Blocks.begin() + From, Blocks.end());
116 CurException; CurException = CurException->ParentException)
130 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));
174 MachineFunctionAnalysisManager::Invalidator &);
187 WasmExceptionInfo.print(OS, M);
assert(UImm &&(UImm !=~static_cast< T >(0)) &&"Invalid immediate!")
static GCRegistry::Add< StatepointGC > D("statepoint-example", "an example strategy for statepoint")
static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")
This header defines various interfaces for pass management in LLVM.
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.
Represent a constant reference to an array (0 or more elements consecutively in memory),...
const_pointer const_iterator
DominatorTree Class - Concrete subclass of DominatorTreeBase that is used to compute a normal dominat...
MachineFunctionPass(char &ID)
A Module instance is used to store all the information related to an LLVM module.
A set of analyses that are preserved following a run of a transformation pass.
A templated base class for SmallPtrSet which provides the typesafe interface that is common across al...
SmallPtrSet - This class implements a set which is optimized for holding SmallSize or less elements.
LLVM_ABI Result run(MachineFunction &MF, MachineFunctionAnalysisManager &MFAM)
WebAssemblyExceptionInfo Result
bool runOnMachineFunction(MachineFunction &MF) override
runOnMachineFunction - This method must be overloaded to perform the desired machine code transformat...
void getAnalysisUsage(AnalysisUsage &AU) const override
getAnalysisUsage - Subclasses that override getAnalysisUsage must call this.
const WebAssemblyExceptionInfo & getWEI() const
void print(raw_ostream &OS, const Module *M=nullptr) const override
print - Print out the internal state of the pass.
void releaseMemory() override
releaseMemory() - This member can be implemented by a pass if it wants to be able to release its memo...
WebAssemblyExceptionInfo & getWEI()
WebAssemblyExceptionInfoWrapperPass()
WebAssemblyExceptionInfo()
void changeExceptionFor(const MachineBasicBlock *MBB, WebAssemblyException *WE)
void addTopLevelException(std::unique_ptr< WebAssemblyException > WE)
void recalculate(MachineFunction &MF, MachineDominatorTree &MDT, const MachineDominanceFrontier &MDF)
void print(raw_ostream &OS, const Module *M) const
WebAssemblyException * getExceptionFor(const MachineBasicBlock *MBB) const
WebAssemblyExceptionInfo & operator=(const WebAssemblyExceptionInfo &)=delete
bool invalidate(MachineFunction &MF, const PreservedAnalyses &PA, MachineFunctionAnalysisManager::Invalidator &)
WebAssemblyExceptionInfo(WebAssemblyExceptionInfo &&)=default
~WebAssemblyExceptionInfo()
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
decltype(SubExceptions)::const_iterator iterator
ArrayRef< MachineBasicBlock * >::const_iterator block_iterator
std::vector< std::unique_ptr< WebAssemblyException > > & getSubExceptions()
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)
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.
Pass manager infrastructure for declaring and invalidating analyses.
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.
AnalysisManager< MachineFunction > MachineFunctionAnalysisManager
raw_ostream & operator<<(raw_ostream &OS, const APFixedPoint &FX)
A CRTP mix-in that provides informational APIs needed for analysis passes.
A special type used by analysis passes to provide an address that identifies that particular analysis...