<div dir="ltr"><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Jun 25, 2013 at 5:15 AM, Evgeniy Stepanov <span dir="ltr"><<a href="mailto:eugenis@google.com" target="_blank" class="cremed">eugenis@google.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":3dy" style="overflow:hidden">+/// FunctionsHaveCompatibleAttributes - Return true if there are no attribute<br>

+/// conflicts between Caller and Callee that prevent inlining.<br>
+static bool FunctionsHaveCompatibleAttributes(Function *Caller, Function *Callee) {<br></div></blockquote><div><br></div><div>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'.</div>
<div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div id=":3dy" style="overflow:hidden">
+  AttributeSet CallerAttr = Caller->getAttributes(),<br>
+               CalleeAttr = Callee->getAttributes();<br>
+<br>
+  if (CallerAttr.hasAttribute(AttributeSet::FunctionIndex,<br>
+                              Attribute::SanitizeAddress) !=<br>
+      CalleeAttr.hasAttribute(AttributeSet::FunctionIndex,<br>
+                              Attribute::SanitizeAddress))<br>
+    return false;</div></blockquote></div><br>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:</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">return MyTestFunction(...) &&</div><div class="gmail_extra">         ...;</div></div>