[llvm-commits] [llvm] r120398 - in /llvm/trunk: lib/Transforms/Scalar/SimplifyLibCalls.cpp test/Transforms/SimplifyLibCalls/Puts.ll

Chris Lattner clattner at apple.com
Tue Nov 30 09:07:48 PST 2010


On Nov 30, 2010, at 2:41 AM, Duncan Sands wrote:

> Hi Anders,
> 
>> +struct PutsOpt : public LibCallOptimization {
>> +  virtual Value *CallOptimizer(Function *Callee, CallInst *CI, IRBuilder<>  &B) {
>> +    // Require one fixed pointer argument and an integer/void result.
> 
> is it correct to allow puts with a void result?  Mightn't this be a sign that
> it is not the puts library function, but something else?

That or that code used an (incorrect) explicit declaration, which happens all the time.  If it is something else, then the code is undefined and we've already lost.  This is one the of assumptions that simplifylibcalls makes.

-Chris





More information about the llvm-commits mailing list