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.
Details
Diff Detail
- Repository
- rL LLVM
Event Timeline
lib/Target/WebAssembly/WebAssemblyUtilities.cpp | ||
---|---|---|
123 ↗ | (On Diff #151632) | How about just return 0 here and return 1 below, with an unreachable as the default? |
lib/Target/WebAssembly/WebAssemblyUtilities.h | ||
44 ↗ | (On Diff #151632) | typo: 'instruction' and line 47 |
58 ↗ | (On Diff #151632) | by 'exception' do you mean try block, catch block, both? what can 'something else' be? |
- Address comments
lib/Target/WebAssembly/WebAssemblyUtilities.h | ||
---|---|---|
58 ↗ | (On Diff #151632) | I meant WebAssemblyException class defined in D44134. Actually this name itself is little confusing, because what it really means is the 'catch' of a wasm exception. I thought about renaming it to WebAssemblyCatch, WebAssemblyExceptionCatch, WebAssemblyEHScope, etc, but none of them really sounded better than this to me. (WebAssemblyEHScope is actually more confusing, because the definition of it is not really same with that of EHScope in general sense.) Here 'something else' meaning, it can possibly be used for another data structure other than loop or exception if we get to have one. Maybe it sounds confusing and is better to be deleted..? |
LGTM with the tweak to the comment.
lib/Target/WebAssembly/WebAssemblyUtilities.h | ||
---|---|---|
58 ↗ | (On Diff #151632) | Maybe just say "either a loop or the catch block of a WebAssemblyException". I'd leave out the "something else" until we have a concrete use, or maybe a more concrete descriptor (e.g. something that will become encompassed by a wasm control-flow construct?). |
lib/Target/WebAssembly/WebAssemblyUtilities.h | ||
---|---|---|
58 ↗ | (On Diff #151632) | 'catch block of a WebAssemblyException' is confusing too because WebAssemblyException itself is only for a catch part. Should we go with just WebAssemblyException? |
lib/Target/WebAssembly/WebAssemblyUtilities.h | ||
---|---|---|
58 ↗ | (On Diff #151632) | Yeah that sounds fine. In the other CL we should make it clear what WebAssemblyException actually refers to. |