[llvm-commits] EmitLibCalls: check TargetLibraryInfo

Eli Friedman eli.friedman at gmail.com
Tue Jul 24 15:11:28 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.

-Eli



More information about the llvm-commits mailing list