[PATCH] D97583: [WebAssembly] Fix reverse mapping in WasmEHFuncInfo

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Feb 26 15:39:41 PST 2021


dschuff accepted this revision.
dschuff added a comment.
This revision is now accepted and ready to land.

LGTM. since the data structure is a `SmallPtrSet` now, it probably makes sense to update the description and maybe the var names to reflect that.



================
Comment at: llvm/include/llvm/CodeGen/WasmEHFuncInfo.h:45
+    assert(hasUnwindSrcs(BB));
+    const auto &Vec = UnwindDestToSrcs.lookup(BB);
+    SmallPtrSet<const BasicBlock *, 4> Ret;
----------------
I guess `Vec` could be named `Set` now since it's a set rather than a vector.


================
Comment at: llvm/lib/Target/WebAssembly/WebAssemblyCFGSort.cpp:266
           bool IsDeferred = false;
-          for (Entry &E : reverse(Entries)) {
-            if (E.TheRegion->getHeader() == UnwindSrc) {
+          for (Entry &E : Entries) {
+            if (UnwindSrcs.count(E.TheRegion->getHeader())) {
----------------
what's the significance of the iteration order here?


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D97583/new/

https://reviews.llvm.org/D97583



More information about the llvm-commits mailing list