[PATCH] D54447: [WebAssembly] Fix broken assumption that all bitcasts are to functions types

Derek Schuff via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Nov 12 15:38:36 PST 2018


dschuff added inline comments.


================
Comment at: lib/Target/WebAssembly/WebAssemblyAddMissingPrototypes.cpp:123
+      User* U = US.getUser();
+      if (BitCastOperator *BC = dyn_cast<BitCastOperator>(U)) {
+        if (BitCastInst *Inst = dyn_cast<BitCastInst>(U)) {
----------------
nit: this (and below) could be `auto` because of the `dyn_cast`


================
Comment at: lib/Target/WebAssembly/WebAssemblyAddMissingPrototypes.cpp:129
+          Inst->replaceAllUsesWith(NewCast);
+          Inst->eraseFromParent();
+        } else if (ConstantExpr *Const = dyn_cast<ConstantExpr>(U)) {
----------------
isn't this modifying F.uses while iterating over it?


Repository:
  rL LLVM

https://reviews.llvm.org/D54447





More information about the llvm-commits mailing list