[llvm-commits] EmitLibCalls: check TargetLibraryInfo
Nuno Lopes
nunoplopes at sapo.pt
Tue Jul 24 19:27:50 PDT 2012
> On Tue, Jul 24, 2012 at 2:14 PM, Nuno Lopes <nunoplopes at sapo.pt> wrote:
>> Hi,
>>
>> Please find in attach a patch that makes EmitLibCalls consult the
>> TargetLibraryInfo data before creating a call to a library function. It
>> makes these Emit*() functions return 0 if the function is not available.
>>
>> Any comments?
>
> The convention of returning null is dangerous, as demonstrated by the
> fact that you messed it up in multiple places. Maybe use
> llvm::Optional?
>
> Otherwise, looks fine.
Thanks for the review!
Actually returning null is really convenient in a number of places, since
instcombine and simplifylibcalls interpret the return of null as "didn't
change anything". I've hopefully audited all call sites.
Nuno
More information about the llvm-commits
mailing list