[PATCH] Disable inlining between sanitized and non-sanitized functions

Chandler Carruth chandlerc at gmail.com
Tue Jun 25 05:20:38 PDT 2013


On Tue, Jun 25, 2013 at 5:15 AM, Evgeniy Stepanov <eugenis at google.com>wrote:

> +/// FunctionsHaveCompatibleAttributes - Return true if there are no
> attribute
> +/// conflicts between Caller and Callee that prevent inlining.
> +static bool FunctionsHaveCompatibleAttributes(Function *Caller, Function
> *Callee) {
>

Please follow the new guidelines for new code. Specifically, doxygen
comments should match the guidance in the coding standards and the function
name should be 'camelCase'.


> +  AttributeSet CallerAttr = Caller->getAttributes(),
> +               CalleeAttr = Callee->getAttributes();
> +
> +  if (CallerAttr.hasAttribute(AttributeSet::FunctionIndex,
> +                              Attribute::SanitizeAddress) !=
> +      CalleeAttr.hasAttribute(AttributeSet::FunctionIndex,
> +                              Attribute::SanitizeAddress))
> +    return false;
>

Hoist this pattern into a helper as well so that adding an attribute is
just a matter of calling the helper with that attribute and the two
attribute sets? Then you can probably just write a single short-circuiting
return:

return MyTestFunction(...) &&
         ...;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130625/c5792c5b/attachment.html>


More information about the llvm-commits mailing list