hans added a subscriber: hans. hans added a reviewer: rnk. hans added a comment.
Just out of curiosity, where does this come up in practice? It seems a little backward that we're first emitting a bunch of instructions, only to remove them later. It would be nice if for naked function we wouldn't emit them in the first place. But maybe that's not practical. Anyway, this seems OK to me but I'd like to hear what Reid thinks too. ================ Comment at: lib/CodeGen/CodeGenFunction.cpp:1954 @@ +1953,3 @@ + // Erase all allocas and their users. + for (auto I = EntryBB->begin(); &*I != &*AllocaInsertPt; ++I) + if (auto Alloca = dyn_cast<llvm::AllocaInst>(&*I)) ---------------- would declaring I as llvm::Instruction* allow you to get rid off the "&*" stuff here and below? If so, same for "auto BB" further down. ================ Comment at: lib/CodeGen/CodeGenFunction.cpp:1972 @@ +1971,3 @@ + ++BB; + else { + BB++->eraseFromParent(); ---------------- i don't think there's any need for curlies around the else branch here, especially since there are none for the then-branch http://reviews.llvm.org/D15599 _______________________________________________ cfe-commits mailing list cfe-commits@lists.llvm.org http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits