<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Feb 22, 2015 at 1:58 AM, NAKAMURA Takumi <span dir="ltr"><<a href="mailto:geek4civic@gmail.com" target="_blank">geek4civic@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Author: chapuni<br>
Date: Sun Feb 22 03:58:19 2015<br>
New Revision: 230169<br>
<br>
URL: <a href="http://llvm.org/viewvc/llvm-project?rev=230169&view=rev" target="_blank">http://llvm.org/viewvc/llvm-project?rev=230169&view=rev</a><br>
Log:<br>
RewriteStatepointsForGC.cpp: Fix for -Asserts to mark isNullConstant() as LLVM_ATTRIBUTE_UNUSED. [-Wunused-function]<br>
<br>
Modified:<br>
    llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp<br>
<br>
Modified: llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp<br>
URL: <a href="http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp?rev=230169&r1=230168&r2=230169&view=diff" target="_blank">http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp?rev=230169&r1=230168&r2=230169&view=diff</a><br>
==============================================================================<br>
--- llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp (original)<br>
+++ llvm/trunk/lib/Transforms/Scalar/RewriteStatepointsForGC.cpp Sun Feb 22 03:58:19 2015<br>
@@ -300,7 +300,7 @@ analyzeParsePointLiveness(DominatorTree<br>
 }<br>
<br>
 /// True iff this value is the null pointer constant (of any pointer type)<br>
-static bool isNullConstant(Value *V) {<br>
+static bool LLVM_ATTRIBUTE_UNUSED isNullConstant(Value *V) {<br></blockquote><div><br>I'm inclined to wrap such functions in 'ifndef NDEBUG' rather than use LLVM_ATTRIBUTE_UNUSED to ensure that if this becomes unused in assertions, we can remove it (rather than it lying around unused indefinitiely). How do other people feel about this?<br><br>Perhaps we could change LLVM_ATTRIBUTE_UNUSED to only expand to the attribute in non-asserts builds so we'd still get the warning in an asserts build that no longer called the function? (at which point maybe have a different macro name for this purpose?)<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
   return isa<Constant>(V) && isa<PointerType>(V->getType()) &&<br>
          cast<Constant>(V)->isNullValue();<br>
 }<br>
<br>
<br>
_______________________________________________<br>
llvm-commits mailing list<br>
<a href="mailto:llvm-commits@cs.uiuc.edu">llvm-commits@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits</a><br>
</blockquote></div><br></div></div>