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