[llvm] r219335 - Inliner: Non-local functions in COMDATs shouldn't be dropped

Chandler Carruth chandlerc at google.com
Wed Oct 8 13:15:00 PDT 2014


On Wed, Oct 8, 2014 at 12:32 PM, David Majnemer <david.majnemer at gmail.com>
wrote:

> +    // It is unsafe to drop a function with discardable linkage from a
> COMDAT
> +    // without also dropping the other members of the COMDAT.
> +    // The inliner doesn't visit non-function entities which are in COMDAT
> +    // groups so it is unsafe to do so *unless* the linkage is local.
> +    if (!F->hasLocalLinkage() && F->hasComdat())
> +      continue;
>

Rather than repeating this everywhere, please make a nice predicate with
this documentation and call it everywhere. F->isDiscardable(), whatever.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20141008/accff2b6/attachment.html>


More information about the llvm-commits mailing list