diff options
author | Heejin Ahn <aheejin@gmail.com> | 2018-06-19 00:32:03 +0000 |
---|---|---|
committer | Heejin Ahn <aheejin@gmail.com> | 2018-06-19 00:32:03 +0000 |
commit | 817811caae9175e088243450ce3b6e006ff337fe (patch) | |
tree | a14914d5ee05bacf574179695124b49fac1b0584 /llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp | |
parent | 33c3fce592cda760250f65fe5713fe3b01935f59 (diff) | |
download | bcm5719-llvm-817811caae9175e088243450ce3b6e006ff337fe.tar.gz bcm5719-llvm-817811caae9175e088243450ce3b6e006ff337fe.zip |
[WebAssembly] Add more utility functions
Summary:
Added more utility functions that will be used in EH-related passes Also
changed `LoopBottom` function to `getBottom` and uses templates to be
able to handle other classes as well, which will be used in CFGSort
later.
Reviewers: dschuff
Subscribers: sbc100, jgravelle-google, sunfish, llvm-commits
Differential Revision: https://reviews.llvm.org/D48262
llvm-svn: 335006
Diffstat (limited to 'llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp')
-rw-r--r-- | llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp b/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp index a53fe28d264..dac9f10524c 100644 --- a/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp +++ b/llvm/lib/Target/WebAssembly/WebAssemblyCFGStackify.cpp @@ -127,7 +127,8 @@ static void PlaceBlockMarker( // Decide where in Header to put the BLOCK. MachineBasicBlock::iterator InsertPos; MachineLoop *HeaderLoop = MLI.getLoopFor(Header); - if (HeaderLoop && MBB.getNumber() > LoopBottom(HeaderLoop)->getNumber()) { + if (HeaderLoop && + MBB.getNumber() > WebAssembly::getBottom(HeaderLoop)->getNumber()) { // Header is the header of a loop that does not lexically contain MBB, so // the BLOCK needs to be above the LOOP, after any END constructs. InsertPos = Header->begin(); @@ -181,7 +182,7 @@ static void PlaceLoopMarker( // The operand of a LOOP is the first block after the loop. If the loop is the // bottom of the function, insert a dummy block at the end. - MachineBasicBlock *Bottom = LoopBottom(Loop); + MachineBasicBlock *Bottom = WebAssembly::getBottom(Loop); auto Iter = std::next(MachineFunction::iterator(Bottom)); if (Iter == MF.end()) { MachineBasicBlock *Label = MF.CreateMachineBasicBlock(); |