ahatanak added inline comments. ================ Comment at: lib/CodeGen/CodeGenFunction.cpp:1962 @@ +1961,3 @@ + for (auto *U : I->users()) + InstrsToRemove.push_back(cast<llvm::Instruction>(U)); + ---------------- manmanren wrote: > Do we need to check if the user has been erased? I am not sure if the same > instruction can be pushed multiple times into InstrsToRemove. I think you are right: it's incorrect to assume an instruction cannot be pushed twice. I'll change the type of InstrsToRemove to a set to prevent that from happenning.
================ Comment at: lib/CodeGen/CodeGenFunction.cpp:1979 @@ +1978,3 @@ + if (auto *T = EntryBB->getTerminator()) + T->eraseFromParent(); + ---------------- manmanren wrote: > Is it possible that T has been erased in the above? I'm not sure I understand. getTerminator will return null if there is no terminator or the basic block is empty, so I think this code is safe? http://reviews.llvm.org/D15599 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits