[PATCH] Prevent user-supplied libc implementations from premature removal in LTO

Rafael EspĂ­ndola rafael.espindola at gmail.com
Tue Nov 5 13:09:15 PST 2013


> +  LibFunc::Func f;
> +  if (isa<Function>(GV) && TLI.getLibFunc(GV.getName(), f))
>
> I don't think this is right, and I'm not sure how to fix it. If you say
> -fno-builtin for example, we won't add anything to this list. So, the
> compiler may delete your user-supplied memcpy, then the  backend will add
> calls to memcpy.

I don't think -fno-builtin propagates all the way here, but that is
still a good point. We probably need a new interface for "is this a
function llvm may produce a call to?". Good news is that that function
can then also handle the compiler-rt symbols.

Cheers,
Rafael



More information about the llvm-commits mailing list