[PATCH] D44134: [WebAssembly] Add WebAssemblyException information analysis
David Majnemer via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Sun May 20 22:38:23 PDT 2018
majnemer added inline comments.
================
Comment at: lib/Target/WebAssembly/WebAssemblyExceptionInfo.cpp:79-90
+ for (auto &MI : *MBB) {
+ if (MI.getOpcode() == WebAssembly::CATCH_ALL) {
+ SeenCatchAll = true;
+ continue;
+ }
+ if (SeenCatchAll && MI.isCall()) {
+ const MachineOperand &CalleeOp = MI.getOperand(0);
----------------
aheejin wrote:
> majnemer wrote:
> > aheejin wrote:
> > > majnemer wrote:
> > > > Is it not possible for the MBB to branch to block which then calls std::terminate?
> > > Hmm, good point... I assumed a terminatepad would be always a single BB but it may not hold. Do you think I should DFS all descendants from here?
> > We handled problems like this one by using getFuncletMembership on the MachineFunction. This does a DFS to let you know which MBBs are part of which catch scopes. I think I'd find a way to reuse it for this.
> Hmm, no, I guess I shouldn't.. doing DFS from all catchpads or cleanuppads sounds like unnecessarily expensive. Should I search for a function call to `__clang_call_terminate` and search upward from there..?
IIRC, getFuncletMembership is O(# MBBs) which is no worse than the fundamental amount of work you are doing here. It shouldn't be a considerable amount of overhead.
Repository:
rL LLVM
https://reviews.llvm.org/D44134
More information about the llvm-commits
mailing list