[PATCH] D18656: [SimplifyLibCalls] Strip dead code in printf() transformations

David Majnemer via llvm-commits llvm-commits at lists.llvm.org
Fri Apr 1 16:32:41 PDT 2016


majnemer accepted this revision.
majnemer added a comment.

LGTM


================
Comment at: lib/Transforms/Utils/SimplifyLibCalls.cpp:1828-1832
@@ -1827,7 +1827,7 @@
 
   // Do not do any of the following transformations if the printf return value
   // is used, in general the printf return value is not compatible with either
   // putchar() or puts().
   if (!CI->use_empty())
     return nullptr;
 
----------------
davide wrote:
> spatel wrote:
> > IMO, the asserts are unnecessary since the check for empty is right here and has a nice explanatory comment too.
> > 
> > If others like the added safety of the asserts, I don't object. There is a proposal to refactor this whole file, so maybe asserts will be handy.
> > 
> > But instead of repeating the assert 5x, add a one-line helper function or lambda?
> My vote is to remove the asserts alltogheter. David?
SGTM


http://reviews.llvm.org/D18656





More information about the llvm-commits mailing list