manmanren added inline comments. ================ Comment at: lib/CodeGen/CodeGenFunction.cpp:1998 @@ +1997,3 @@ + if (auto *T = EntryBB->getTerminator()) + T->eraseFromParent(); + ---------------- Yes, you are right. http://reviews.llvm.org/D15599